Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save perXautomatik/b403c938c0ea3f78ec1d197c3dbf8368 to your computer and use it in GitHub Desktop.
Save perXautomatik/b403c938c0ea3f78ec1d197c3dbf8368 to your computer and use it in GitHub Desktop.
save current clipboard contents to another variable, then use copy, save to variable, put original clipboard contents back. Url: https://www.autohotkey.com/board/topic/39280-get-selected-text/
#c::
oCB := ClipboardAll ; save clipboard contents
Send, ^c
ClipWait,1
< do whatever you originally wanted with selected text in "clipboard" variable >
ClipBoard := oCB ; return original Clipboard contents
return
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment