Skip to content

Instantly share code, notes, and snippets.

@JamoCA
Last active December 20, 2015 06:58
Show Gist options
  • Save JamoCA/6089767 to your computer and use it in GitHub Desktop.
Save JamoCA/6089767 to your computer and use it in GitHub Desktop.
AutoHotKey script to remove hidden Microsoft mark-up from the clipboard when pasting from Word to online WYSIWYG editors, cleaning up Outlook replies, removing trailing non-breaking spaces or using the "Paste as Value" function in Excel. (Windows+V)
REMOVECHAR:
AutoTrim,Off
StringCaseSense,On
StringReplace,string,string,chr(160),A_Space,All ;Non-breaking space
StringReplace,string,string,–,-,All ;emdash
StringReplace,string,string,´,',All
StringReplace,string,string,’,',All
StringReplace,string,string,©,(C),All
StringReplace,string,string,“,",All ;left quote
StringReplace,string,string,”,",All ;right quote
StringReplace,string,string,®,(R),All
StringReplace,string,string,¼,1/4,All
StringReplace,string,string,½,1/2,All
StringReplace,string,string,¾,3/4,All
StringReplace,string,string,™,TM,All
StringReplace,string,string,«,<<,All
StringReplace,string,string,»,>>,All
StringReplace,string,string,„,",All
StringReplace,string,string,•,-,All ;bullet
StringReplace,string,string,…,...,All
Return
#v:: ;Windows+V Strip Formatting and Paste Clipboard
string = %clipboard%
Gosub,REMOVECHAR
clipboard := RegExReplace(string, "(^\s+)|(\s+$)")
SendPlay,^v
return
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment