I want to create a script and am in a desperate need of your help. All I want the script to do is:
1. I start the script
2. i open one ore more window with the special ahk_class
3. script is counting how many of them is running
4. sends a keystroke until i have the desired amount of window with that ahk_class running
5. when i have less than desired, sends thekeystroke again. That way it makes sure i have always 3 windows running
plus option: woud be nice if i coud determine how many windows i want to be opened/closed. after i reach the total amount, script would stop.
This is what I have at this moment:
Code: Select all
#SingleInstance
windowsneeded = 3
Loop
{
numwindows := 0
WinGet, id, list, ahk_class ...,, Program Manager
Loop, %id%
{
numwindows += 1
}
if (numwindows < windowsneeded)
{
sendinput ...
}
Sleep 1000
}
return
thanks for your help in advance guys!