I had someone create an AutoHotkey script for me and it was working fine until recently when I updated AutoHotkey. Now it just gives me this error and won’t run anymore:
Error
Here is the script. Can someone please help me?:
SendMode(“Input”)
SetWorkingDir(A_ScriptDir)
SetCapsLockState(“AlwaysOff”)
Second_Hotkey_Array := [“i”, “j”, “k”, “l”, “u”, “o”, “y”, “h”, “Backspace”, “Esc”, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, “-“, “=”, “w”, “a”, “s”, “d”, “Space”, “m”]
Replace_Array := [“{up}”, “{left}”, “{down}”, “{right}”, “{home}”, “{end}”, “{PgUp}”, “{PgDn}”, “{Delete}”, “{vkc0}”, “{f1}”, “{f2}”, “{f3}”, “{f4}”, “{f5}”, “{f6}”, “{f7}”, “{f8}”, “{f9}”, “{f10}”, “{f11}”, “{f12}”, “{Volume_Up}”, “{Media_Prev}”, “{Volume_Down}”, “{Media_Next}”, “{Media_Play_Pause}”, “{Volume_Mute}”]
For index, Second_Hotkey in Second_Hotkey_Array
HotKey(“CapsLock & ” Second_Hotkey, CapsLock_Func, Replace_Array[index])
CapsLock_Func(ThisHotkey) {
global Replace_Array
Replace_Key := Replace_Array[get_Second_Hotkey_Index(ThisHotkey)]
if(GetKeyState(“Shift”, “P”)) {
if(GetKeyState(“Alt”, “P”)) {
if(GetKeyState(“Ctrl”, “P”))
Send(“+!^” Replace_Key)
else
Send(“+!” Replace_Key)
}
else if(GetKeyState(“Ctrl”, “P”))
Send(“+^” Replace_Key)
else
Send(“+” Replace_Key)
}
else if(GetKeyState(“Ctrl”, “P”)) {
if(GetKeyState(“Alt”, “P”))
Send(“^!” Replace_Key)
else
Send(“^” Replace_Key)
}
else if(GetKeyState(“Alt”, “P”))
Send(“!” Replace_Key)
else if(GetKeyState(“LWin”, “P”))
Send(“#” Replace_Key)
else
Send(Replace_Key)
return
}
get_Second_Hotkey_Index(Hotkey) {
global Second_Hotkey_Array
ThisHotkey_SHk := SubStr(Hotkey, 12)
For index, SHk in Second_Hotkey_Array {
if(ThisHotkey_SHk = SHk)
return index
}
return 0
}
HansMoleman is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.