Your script doesn't give wordpad enough time to open.Try this one:
CopyPasteNotepad.kix
code:
break on cls del "c:\filename.txt"
; write your name to a blank screen
@userid ?
; copy this to the clipboard
$=sendkeys("~ es{enter}")
; run notepad
run "notepad"
; loop until notepad has focus
while setfocus("Untitled - Notepad")<>0 loop
; uncomment ONE of the following only:
; paste clipboard to notepad
$=sendkeys("^v")
; paste clipboard, save as 'c:\filename.txt' and exit notepad
;$=sendkeys("^v^sc:\filename.txt{enter}~{f4}")
The While...Loop causes the script to pause until notepad is running.
cj
[This message has been edited by cj (edited 05 April 2001).]