Home » Questions » Computers [ Ask a new question ]

AutoHotkey: how to send contents of clipboard as key presses?

AutoHotkey: how to send contents of clipboard as key presses?

I'm making an autohotkey script to run highlighted text through a calculator, and i need to send the contents of the clipboard as a sequence of keypresses, since the calculator doesn't really support pasting of a mathematical operation. How would this be accomplished?

Asked by: Guest | Views: 260
Total answers/comments: 2
Guest [Entry]

"I fixed the original script you wrote here: superuser.com/questions/7271/most-useful-autohotkey-scripts/31282#31282 Works fine on my Vista system now.

The code snippet in question, dredged up from the depths of the Wayback Machine:

^!c::
ClipSave := ClipboardAll
Send ^x
Run calc.exe
WinWaitActive Calculator
Send ^v
Send {Enter}
Sleep 250
Send ^c
WinClose
Send ^v
Clipboard := ClipSave
return"
Guest [Entry]

"To map Ctrl + K to send clipboard data for example:

^k::Send %clipboard%"