在Autohotkey脚本中添加以下代码:
#Persistent SetTimer, AutoExecute, 1000 return
AutoExecute: IfWinExist, ahk_class AutoHotkey { WinGetTitle, Title, ahk_class AutoHotkey IfInString, Title, "-" { StringGetPos, Pos, Title, -, R StringLeft, Title, Title, %Pos% - 1 WinSet, AlwaysOnTop, Off, ahk_class AutoHotkey WinActivate, %Title%, ahk_class AutoHotkey WinSet, AlwaysOnTop, On, ahk_class AutoHotkey SendInput, {Alt Down}{F4}{Alt Up} } } return
这段代码让Autohotkey脚本自动执行,并解决了Autohotkey不自动执行的问题。