How to know whether script is running? Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
User avatar
Gyro-Gearloose
Posts: 121
Joined: 03 Jan 2020, 16:13

How to know whether script is running?

20 Jun 2020, 10:41

I seem to be captured by an endless loop. as this
Run C:\Users\Helmut\Desktop\---AHK---\any-race.exe
opens invariably the Smart GUI-Creator.
In order to find out which program files of type .ahk are associated with,
I perform a double click on any-race.exe and see this message:
Whether I click no or yes makes no difference. The message pops up again an again.
Attachments
Mono - 02383.jpg
Mono - 02383.jpg (46.98 KiB) Viewed 4299 times
vsub
Posts: 541
Joined: 29 Sep 2015, 03:39

Re: How to know whether script is running?

20 Jun 2020, 10:57

I am not sure exactly what you mean
That any-race.exe is a compiled autohotkey script and when you try to run it again you get that message
You get that message because the script is already running

Clicking Yes will restart it and clicking no will do nothing and that's expected
User avatar
Gyro-Gearloose
Posts: 121
Joined: 03 Jan 2020, 16:13

Re: How to know whether script is running?

20 Jun 2020, 11:28

The problem seems to be how to find out whether this or any script is running. If I perform a quick run from SciTE4-Editor a symbol appears in the taskbar. I use this symbol for example to suspend hotkeys. But there is no such symbol now. I can only check whether a script is running by trying some of the hotkeys I defined. How to end a running script if I don't know which scripts are currently running? As you see, there is no AHK symbol in the taskbar, yet a script is running.
Attachments
Mono - 02389.jpg
Mono - 02389.jpg (10.96 KiB) Viewed 3720 times
User avatar
Gyro-Gearloose
Posts: 121
Joined: 03 Jan 2020, 16:13

Re: How to know whether script is running?

20 Jun 2020, 11:44

OK. I know, what scripi is running. Is is beach-party.exe. How to stop it then? Don't tell me a system restart.
vsub
Posts: 541
Joined: 29 Sep 2015, 03:39

Re: How to know whether script is running?  Topic is solved

20 Jun 2020, 12:20

Click on the ^ arrow in the tray and close it by clicking on the script icon and choose exit

This script will check if you have running scripts and ask you if you want to close them(one by one)

Code: Select all

DetectHiddenWindows,on
#SingleInstance,Force
WinGet,ID,List,ahk_class AutoHotkey
Loop, %ID%
Count := A_Index
Count -= 1
If Count = 0
ExitApp
Loop, %ID%
{
ID := ID%A_Index%
If A_Index = 1
Continue
Else
{
WinGetTitle,Title,ahk_id %ID%
MsgBox,3,% "Close Script " A_Index - 1 "/" Count ,% Title
IfMsgBox,Yes
WinClose,ahk_id %ID%
IfMsgBox,Cancel
ExitApp
}
}
ExitApp

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Bing [Bot], supplementfacts and 110 guests