Sorry, usually you can get away without doing this if it's just text, but here's the more correct way:
Code:
#k::
Clipboard =
sendinput ^c
ClipWait
msgbox clipboard=%clipboard%
return
Or if you prefer, you're welcome to use my GetText function from
this script.
Code:
#k::
GetText(FileName)
msgbox clipboard=%FileName%
return
GetText(ByRef MyText = "")
{
SavedClip := ClipboardAll
Clipboard =
Send ^c
ClipWait 0.1
If ERRORLEVEL
{
Clipboard := SavedClip
MyText =
ERRORLEVEL := 1
Return
}
MyText := Clipboard
Clipboard := SavedClip
Return MyText
}
That has the extra feature of preserving the previous clipboard contents.