Knowbodynow wrote:
Thanks, so do you mean if I avoid using ctr+v and clear the contents of the clipboard after the operation there should be no problem?
Correct, or, better yet, you can restore the previous contents - so it doesn't interfer with what's already there. The function below just merges the examples from
Clipboard and
ClipboardAll. I tested it by coping some data in paint, then using the hotkey; it restored the previous data with no problems. Thanks for this idea - I have a new function to add to my library

.
Code:
#F9::
{
UseClipboard(MyVar)
MsgBox, % "You just copied: " . MyVar
return
}
UseClipboard(ByRef OutputVar)
{
; Save the entire clipboard to a variable of your choice.
ClipSaved := ClipboardAll
; Start off empty to allow ClipWait to detect when the text has arrived.
Clipboard =
Send, ^c
; Wait for the clipboard to contain text.
Clipwait
; Saves Clipboard contents (to be returned ByRef)
OutputVar := Clipboard
; Restore the original clipboard. Note the use of Clipboard (not ClipboardAll).
Clipboard := ClipSaved
}
_________________
As always, if you have any further questions, don't hesitate to ask.
Add OOP to your scripts via the
Class Library. Check out
my scripts.