我是否必须将 `SetTitleMatchMode` 放在脚本之上?
Do I have to put `SetTitleMatchMode` on top of the script?
示例脚本:
#NoEnv
#Warn
#SingleInstance Force
#IfWinActive Foo ahk_exe foo.exe
!A::Send Foo
SetTitleMatchMode Regex
#IfWinActive Bar$ ahk_exe bar.exe
!A::Send Bar
当运行它时,解释器抛出:
我只想将 SetTitleMatchMode Regex
应用到 bar.exe
,如果不将其放在脚本之上是否可以实现?
Every newly launched thread (such as a hotkey, custom menu item, or timed subroutine) starts fresh with the default setting for this command. That default may be changed by using this command in the auto-execute section (top part of the script).
引用自The Top of the Script (the Auto-execute Section):
After the script has been loaded, it begins executing at the top line, continuing until a Return, Exit, hotkey/hotstring label, or the physical end of the script is encountered (whichever comes first). This top portion of the script is referred to as the auto-execute section.
示例脚本:
#NoEnv
#Warn
#SingleInstance Force
#IfWinActive Foo ahk_exe foo.exe
!A::Send Foo
SetTitleMatchMode Regex
#IfWinActive Bar$ ahk_exe bar.exe
!A::Send Bar
当运行它时,解释器抛出:
我只想将 SetTitleMatchMode Regex
应用到 bar.exe
,如果不将其放在脚本之上是否可以实现?
Every newly launched thread (such as a hotkey, custom menu item, or timed subroutine) starts fresh with the default setting for this command. That default may be changed by using this command in the auto-execute section (top part of the script).
引用自The Top of the Script (the Auto-execute Section):
After the script has been loaded, it begins executing at the top line, continuing until a Return, Exit, hotkey/hotstring label, or the physical end of the script is encountered (whichever comes first). This top portion of the script is referred to as the auto-execute section.