Hello,
I would like to close an AHK script that is running in a loop, FROM ANOTHER AHK SCRIPT.
I try something :
My loop is "LOOOP.ahk" :
Loop
{
MsgBox nice
}
And I want close my loop with "CLOSE LOOOP.ahk" :
ExitApp, LOOOP.ahk
But my script "CLOSE LOOOP.ahk" does not work.
I don't know if I was understanding, but if someone could help me ..
close an AHK scrip from another AHK script
Re: close an AHK scrip from another AHK script
Welcome to this AutoHotkey forum!
See documentation & syntax for ExitApp, which does not accept a script as a parameter. You cannot make up your own syntax; you need to use what AHK provides.
To close another script, use DetectHiddenWindows, On, and then WinClose followed by the script's window title. A script's window title starts with the full path to the script, which is sufficient. Window titles are case-sensitive.
Life gets easier if you combine your scripts. You can then just use a variable to indicate when to break the loop.
Explained: WinClose • WinTitle
See documentation & syntax for ExitApp, which does not accept a script as a parameter. You cannot make up your own syntax; you need to use what AHK provides.
To close another script, use DetectHiddenWindows, On, and then WinClose followed by the script's window title. A script's window title starts with the full path to the script, which is sufficient. Window titles are case-sensitive.
Life gets easier if you combine your scripts. You can then just use a variable to indicate when to break the loop.
Code: Select all
DetectHiddenWindows, On
WinClose, %A_ScriptDir%\test.ahk ahk_class AutoHotkey