Yeah, the syntax differs! Feel free to post any questions, along with your transformed script.
Multi-line hotkey subroutines are OK in either version.
Code: Select all
#Requires AutoHotkey v1.1.33
#If WinActive("ahk_class BricscadMainWindow")
^!5::
SendInput (cmd_setenv "epcb_cmd" "PROJ_ANALYS"){Enter}
Sleep 5000
SendInput (cmd_setenv "epcb_cmd" "PROJ_XREF"){Enter}
Return
#If
Concepts:
1. A multi-line subroutine should have a hotkey on the first line,
by itself.
2. In v1, a subroutine ends with a
Return command. If a command is on the same line as the hotkey, then a
Return after the command is implicit.
3. Without any return, a script proceeds to the next statement.
Code: Select all
#Requires AutoHotkey v2.0
#HotIf WinActive("ahk_class BricscadMainWindow")
^!5:: {
Send '(cmd_setenv "epcb_cmd" "PROJ_ANALYS"){Enter}'
Sleep 5000
Send '(cmd_setenv "epcb_cmd" "PROJ_XREF"){Enter}'
}
#HotIf