Code: Select all
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
#SingleInstance force
^m::
Loop
{
Sleep 500
MsgBox Loop Cnt is "%A_Index%".
if A_Index > 9
{
ExitApp
}
WinGetTitle, Title, A
MsgBox Active Window is "%Title%"
}
until Title := "C:\Users\BillWilson\Temp\Test1"
; Found it; Close it
WinKill "C:\Users\BillWilson\Temp\Test1"
return