AutoIt – Monitor Window Title

email me

This is how you monitor for a window title, and then do something when the window appears.

Opt("TrayIconHide", 1) ;0=show, 1=hide tray icon;hides the icon

Global $i = 0
DO
Sleep(1000) ;wait 1 second
If WinExists("TheWindowTitle") Then
WinActivate("TheWindowTitle")
;Send("{Enter}") ;you could send a key
;Run("RUN SOMETHING") ;you could execute a program
;ExitLoop
; $i = 20
EndIf
;$i = $i + 1
UNTIL $i > 1