Skip to content

Instantly share code, notes, and snippets.

@DaneWeber
Last active August 29, 2015 14:22
Show Gist options
  • Save DaneWeber/966f81fc627b05113055 to your computer and use it in GitHub Desktop.
Save DaneWeber/966f81fc627b05113055 to your computer and use it in GitHub Desktop.
; Copied from http://www.autohotkey.com/board/topic/10412-paste-plain-text-and-copycut/
#v:: ; Text–only paste from ClipBoard | WIN and V keys are the hotkey
KeyWait, LWin ; Wait for the Windows key to be lifted,
KeyWait, RWin ; since it would sometimes combine with the pasted text.
OldClip = %ClipBoardAll% ; Save formatted text for later
ClipBoard = %ClipBoard% ; Convert to text
Send ^v ; For best compatibility: SendPlay | simulates pressing CRTL and V keys
Sleep 50 ; Don't change clipboard while it is pasted! (Sleep > 0)
ClipBoard = %OldClip% ; Restore original ClipBoard
VarSetCapacity(OldClip, 0) ; Free memory
Return
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment