Closing of a specific AHK script (can get it to work in AHK 1.1.37.01)

Discussion, questions and support.
Post Reply
User avatar
Oblomov
Posts: 188
Joined: Mar 4th, ’19, 19:44

Post by Oblomov » Apr 17th, ’24, 10:51

I've got this inside of an AHK script:

Code: Select all

fullScriptPath = C:\Users\David\Dropbox\Scripts\AHK scripts\SomeText\Sometext.ahk

DetectHiddenWindows, On 
WinClose, %fullScriptPath% ahk_class AutoHotkey
Which works inside of an AHK script 1 (with which it closes AHK script 2, basically some other one, currently open). However, I just can't seem to get this to work inside of FK... would really appreciate some help with this.

P.S. Using FK 4.29
User avatar
Marko
Posts: 1842
Joined: Mar 2nd, ’13, 21:02

Post by Marko » Apr 19th, ’24, 20:35

Use WinClose by specifying the window title instead:

Code: Select all

WinClose, testfly.ahk
User avatar
Oblomov
Posts: 188
Joined: Mar 4th, ’19, 19:44

Post by Oblomov » Apr 19th, ’24, 21:08

Marko wrote: Apr 19th, ’24, 20:35 Use WinClose by specifying the window title instead:

Code: Select all

WinClose, testfly.ahk
Thanks for the comment Marko! I've just tried this with a script on my end called 'Test.ahk', but unfortunately 'WinClose' didn't terminate it...
User avatar
Oblomov
Posts: 188
Joined: Mar 4th, ’19, 19:44

Post by Oblomov » Jan 4th, ’25, 09:39

Marko wrote: Apr 19th, ’24, 20:35 Use WinClose by specifying the window title instead:

Code: Select all

WinClose, testfly.ahk
Still wondering about how I'm to actually do it in FK tbh. 🥺👉👈
User avatar
Marko
Posts: 1842
Joined: Mar 2nd, ’13, 21:02

Post by Marko » Jan 6th, ’25, 18:00

How about this?

Code: Select all

name:="test.ahk"
DetectHiddenWindows On
SetTitleMatchMode RegEx
IfWinExist, i)%Name%.* ahk_class AutoHotkey
{
	WinClose
	WinWaitClose, i)%Name%.* ahk_class AutoHotkey, , 2
}
User avatar
Oblomov
Posts: 188
Joined: Mar 4th, ’19, 19:44

Post by Oblomov » Jan 9th, ’25, 16:41

Marko wrote: Jan 6th, ’25, 18:00 How about this?

Code: Select all

name:="test.ahk"
DetectHiddenWindows On
SetTitleMatchMode RegEx
IfWinExist, i)%Name%.* ahk_class AutoHotkey
{
	WinClose
	WinWaitClose, i)%Name%.* ahk_class AutoHotkey, , 2
}
Thanks for the input Marko! Unfortunately it didn't work still... Happy NY btw.
Post Reply