I wrote a hotkey with the following code:
Code: Select all
Send ^c
ClipWait,1
If (ErrorLevel=1)
{
MsgBox,4144,Error,No text appeared on clipboard after Ctrl+c and waiting for one second
Return
}
; process text on clipboard
To fix it, I added Clipboard:="" before the Send ^c. I then saw that this matches example #1 at the ClipWait doc and the "Using ClipWait to improve script reliability" example at the Clipboard doc.
Yes, that works, but it shows that Send ^c has not finished putting new text on the clipboard before it falls through to the next statement. This raises the question of how to know when Send ^c has placed ALL of the new text on the clipboard. In other words, when can we be certain that after success from ClipWait (i.e., ErrorLevel=0) that ALL of the new text is there, especially when the Ctrl+c is copying a large amount of text?
Thanks, Joe