count total instances of running script Topic is solved
count total instances of running script
When multiple instances of a script are running (via the #SingleInstance, Off directive), how can a script count how many instances are currently running?
Re: count total instances of running script Topic is solved
Probably WinGet, var, list, ahk_exe autohotkey.exe with DetectHiddenWindows, On, and then parsing that list for the name of the script when using WinGetTitle; see Example #2 at bottom of the WinGet documentation. Count the number of matches.
Re: count total instances of running script
Ah yes, that is exactly what I was looking for. Thank you, @Exaskryz!
This does the trick nicely:
This does the trick nicely:
Code: Select all
DetectHiddenWindows, On
SetTitleMatchMode, 2
WinGet, ThreadCount, list, part_of_title ahk_class AutoHotkey
MsgBox % ThreadCount
Who is online
Users browsing this forum: Holarctic, mapcarter, robnicholson, Rohwedder and 329 guests