Skip to content

Instantly share code, notes, and snippets.

@JamoCA
Last active July 10, 2024 15:12
Show Gist options
  • Save JamoCA/1d6d4a14b3ccfd9b3a0bf94db0c447ed to your computer and use it in GitHub Desktop.
Save JamoCA/1d6d4a14b3ccfd9b3a0bf94db0c447ed to your computer and use it in GitHub Desktop.
AutoHotKey Script to emulate typing. Use CTRL+SHIFT+V to paste clipboard character-by-character as if typing.
^+v:: ; paste text and emulate typing (CTRL+SHIFT+V)
AutoTrim,On
string = %clipboard%
Gosub,ONLYTYPINGCHARS
StringSplit, charArray, string
Loop %charArray0%
{
this_char := charArray%a_index%
Send {Text}%this_char%
Random, typeSlow, 1, 3
typeMin = 50
typeMax = 150
if (typeSlow >= 3){
typeMin = 150
typeMax = 350
}
Random, t, typeMin, typeMax
Sleep, %t%
}
Return
ONLYTYPINGCHARS:
AutoTrim,Off
StringCaseSense,On
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
StringReplace,string,string,`r`n,`n,All ;replace newlines
StringReplace,string,string,chr(0),A_Space,All ;NULL
StringReplace,string,string,chr(9),A_Space,All ;Horizontal Tab
StringReplace,string,string,chr(10),A_Space,All ;Line Feed
StringReplace,string,string,chr(11),A_Space,All ;Vertical Tab
StringReplace,string,string,chr(14),A_Space,All ;Column Break
StringReplace,string,string,chr(160),A_Space,All ;Non-breaking space
Return
@JamoCA
Copy link
Author

JamoCA commented Jun 7, 2024

@Calamardins Good catch! I've updated the gist.

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