I am using this excellent WinTrigger script from the user MasterFocus, so that a code is executed whenever a specific window becomes active.
https://autohotkey.com/board/topic/5905 ... f-windows/
Code: Select all
ProgWinTitle1 = WinTitle
WinTrigger1 = Active
CheckPeriod = 1000
SetTimer, LabelCheckTrigger, %CheckPeriod%
Return
LabelCheckTrigger:
While ( ProgWinTitle%A_Index% != "" && WinTrigger := WinTrigger%A_Index% )
if ( !ProgRunning%A_Index% != !Win%WinTrigger%( ProgWinTitle := ProgWinTitle%A_Index% ) )
GoSubSafe( "LabelTriggerO" ( (ProgRunning%A_Index% := !ProgRunning%A_Index%) ? "n" : "ff" ) A_Index )
Return
Because of this, now I need some extra method so that AHK understands when I have switched to a new window, while the new and the old window have the same WinTitle.
Any idea how I can fix this? Other than this special case, the WinTrigger script works fine and I recommend it.