Skip to content

Instantly share code, notes, and snippets.

@jadient
Last active March 9, 2021 05:31
Show Gist options
  • Save jadient/783248 to your computer and use it in GitHub Desktop.
Save jadient/783248 to your computer and use it in GitHub Desktop.
AutoHotKey script to paste text without formatting
; WindowsKey-V shortcut to paste text with no formatting
; (like Paste Special > Plain Text, but faster and works everywhere)
; for AutoHotKey
#v::
ClipSaved := ClipboardAll
tempClipboard = %clipboard%
Clipboard = %tempClipboard%
SendPlay ^v
Clipboard := ClipSaved
; add an arbitrary delay to increase reliability for certain apps
Sleep 100
return
@asheroto
Copy link

asheroto commented Mar 9, 2021

Hey there, thanks for writing this. AutoHotkey changed a bit since you wrote this, so I've adjusted the script.

  • Vars don't need to have a % sign now
  • Some apps like Microsoft Word are slow and if you reset the clipboard too fast it will end up pasting the original clipboard

I have forked+edited version here, might want to update yours! Your gist shows up on Google so I figured other people might want to have the updated version.

@jadient
Copy link
Author

jadient commented Mar 9, 2021

Thanks for your comment. I still use that code with the percent signs, need to go thru the documentation one of these days to see what else I'm missing. Like you, I found that a delay was needed, and I've updated the gist accordingly.

@asheroto
Copy link

asheroto commented Mar 9, 2021

Glad you're still around after 10 years of posting it! Ha!

Percent signs still work, it's just considered the "legacy" version of variables.

@asheroto
Copy link

asheroto commented Mar 9, 2021

Also, there is some type of bug between SendPlay and Microsoft Word. If I use SendPlay it doesn't work in word, just, nothing. But if I change it to Send, it works.

Not sure if that's an issue with Word 2019 or just Word period.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment