Blackholyman, I'm sorry but I'm not sure understand your reasoning for the
Sleep ("
...the script does not know when the program is done pasting")
When I tried to use
ClipWait, I cleared the clipboard. But this does not work
Code: Select all
SendFast: ; WARNING: FastText must be defined before jumping here!
ClipSaved := ClipboardAll ; saves current clipboard content
Clipboard := ""
Clipboard := FastText ; prepares text to be pasted
ClipWait
Send, ^v ; pastes text (fastest way to "write")
Clipboard := ClipSaved ; restores clipboard to its original content
Return
When I adapt your code, it works
Code: Select all
SendFast: ; WARNING: FastText must be defined before jumping here!
ClipSaved := ClipboardAll ; saves current clipboard content
Clipboard := ""
Clipboard := FastText ; prepares text to be pasted
ClipWait
Send, ^v ; pastes text (fastest way to "write")
Sleep, 200
Clipboard := ClipSaved ; restores clipboard to its original content
Return
But so does this
Code: Select all
SendFast: ; WARNING: FastText must be defined before jumping here!
ClipSaved := ClipboardAll ; saves current clipboard content
; Clipboard := ""
Clipboard := FastText ; prepares text to be pasted
; ClipWait
Send, ^v ; pastes text (fastest way to "write")
Sleep, 200
Clipboard := ClipSaved ; restores clipboard to its original content
Return
And it actually works with just a
Sleep, 100, so we're almost back to my code. It seems that the
Sleep command is needed, but it turns out it works both before the pasting, and between the pasting and the restoring of the clipboard
With "
...the script does not know when the program is done pasting", did you mean that without the
Sleep the clipboard was restored
before the pasting finished? If so, why does my code (from the previous message) also works?
Regards,
Antonio B.