The following code works for me:-

break on

Run "C:\Windows\Notepad"

Sleep 3

If SetFocus("Untitled - Notepad") <> 0

"Error SetFocus to Notepad" ?
Exit 2

Endif

$ = SendKeys("The cat sat on the mat{ENTER}")
$ = SendKeys("{UP}")
$ = SendKeys("+{END}")
_________________________
Bill