Close all AHK scripts Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Fulminare
Posts: 369
Joined: 26 Jun 2021, 20:15

Close all AHK scripts

24 Sep 2021, 00:33

Hi everyone !

I have 4-5 active scripts that need to be closed.

This code is working fine

Code: Select all

Loop
{
#Singleinstance force
Process, Close, Autohotkey.exe
}
But the scripts (which are minimised as tray icons) close only when I hover the mouse over them,

Like, I run the above scripts, the 4-5 active ahk scripts don't close by themselves.

The tray menu needs to be opened and only after I place the mouse cursor on each of the minimised scripts they get closed.

Is there any better alternative to this ?

Regards.
Rohwedder
Posts: 7630
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Close all AHK scripts  Topic is solved

24 Sep 2021, 01:06

Hallo,
try:

Code: Select all

q::
DetectHiddenWindows, On
WinGet, AHKList, List, ahk_exe Autohotkey.exe
Loop, %AHKList%
	IF (A_ScriptHwnd <> ID := AHKList%A_Index%)
		WinClose, ahk_id %ID%
ExitApp
Fulminare
Posts: 369
Joined: 26 Jun 2021, 20:15

Re: Close all AHK scripts

24 Sep 2021, 01:44

Thanks Rohwedder, it is working :)

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: mikeyww, segolore and 331 guests