I noticed that the docs for IfWinActive include an alert stating:
Deprecated: This command is not recommended for use in new scripts. Use the WinActive() function instead.
The syntax shown for WinActive() begins with:
Question 1: What does that mean and must it be included?UniqueID :=
The syntax also indicates that WinTitle should be included (as it is for IfWinActive), but the following example is given:
Code: Select all
if WinActive("ahk_class Notepad") or WinActive("ahk_class" . ClassName) ; "ahk_class" need not have a space after it.
WinClose ; Uses the last found window.
Code: Select all
SetTitleMatchMode, 2
IfWinActive, Excel
{...}
Return
Question 3: What is the simplest/shortest way to retain a hotkey's native function as the Else action if (and only if) an If criteria is not satisfied?
For example:
Code: Select all
Space::
SetTitleMatchMode, 2
IfWinActive, Excel
{...}
Else
Send {Space}
Return