Created
February 6, 2023 07:04
-
-
Save Naetmul/c609dab5414c6ba060491cba9ba20a89 to your computer and use it in GitHub Desktop.
AutoHotkey script to "Paste As Text" when Ctrl+Win+V is pressed (for AHK v2.0)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Requires AutoHotkey v2.0 | |
^#v:: ; Ctrl + Win + V | |
{ | |
ClipboardOld := ClipboardAll() ; Save the original clipboard contents | |
; A_Clipboard is a built-in variable that reflects the current contents of | |
; the Windows clipboard if those contents can be expressed as text. | |
A_Clipboard := A_Clipboard | |
SendInput "^v" ; Send Ctrl + V (SendInput is faster than Send) | |
Sleep 250 ; Give some time to finish paste (before restoring clipboard) | |
; The built-in variable A_Clipboard reflects the current contents of the | |
; Windows clipboard expressed as plain text, but can be assigned a | |
; ClipboardAll object to restore its content to the clipboard. | |
A_Clipboard := ClipboardOld | |
ClipboardOld := "" ; Clear temporary variable (potentially contains large data) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment