我使用AutoHotKey 中的WinClose 脚本来关闭带有Ctrl+ w(^w) 的窗口。由于Ctrl+w有时已经是关闭窗口(或 Firefox 中的选项卡)的快捷方式,所以我再次发送一个Ctrl+ w,然后我猜它会以无限循环结束。我该如何解决?
这是错误消息:

这是我的脚本:
;;; make the “CTRL+W” key to close window or tab.
; which key to send depends on the application
^w::
IfWinActive ahk_class ATH_Note
{ ; ATH_Note is Windows Mail
; Ctrl+F4
Send !{F4}
}
IfWinActive ahk_class Notepad
{ ; Alt+F4
Send !{F4}
}
Else IfWinActive ahk_class Outlook Express Browser Class
{ WinMinimize, A
}
Else IfWinActive ahk_class IrfanView …Run Code Online (Sandbox Code Playgroud)