Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Auto Hotkey (AHK) script to paste clipboard content removing non alphanumeric caracters (Hotkey - Ctrl + Alt + Shift + T)
; To be used to paste CPF / CNPJ / bar code copied to clipboard
Sleep, 100
ClipSaved := ClipboardAll ;save original clipboard contents
Clipboard := RegExReplace(Clipboard, "[^a-zA-Z0-9]", "")
Sleep, 100
Send ^v ;send the Ctrl+V command
Sleep, 100
Clipboard := ClipSaved ;restore the original clipboard contents
ClipSaved = ;clear the variable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.