Created
September 2, 2024 17:45
-
-
Save jorgepsmatos/2cef9b836553d7619e89ad143a305f4f to your computer and use it in GitHub Desktop.
loopwindows.ahk
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Persistent | |
Toggle := false ; Initialize the toggle state to "off" | |
Return | |
^!t:: ; Hotkey: Ctrl + Alt + T | |
Toggle := !Toggle ; Toggle the state (on/off) | |
If (Toggle) | |
{ | |
SetTimer, LoopWindows, 6000 ; Start the timer | |
} | |
Else | |
{ | |
SetTimer, LoopWindows, Off ; Stop the timer | |
} | |
Return | |
; https://www.autohotkey.com/boards/viewtopic.php?style=17&t=97103 | |
LoopWindows() | |
{ | |
win := [] | |
WinGet, wins, List | |
Loop, %wins% { | |
WinGetTitle, ttitle, % winTitle := "ahk_id " wins%A_Index% | |
WinGet, proc, ProcessName, %winTitle% | |
WinGetClass, class, %winTitle% | |
If (ttitle > "" && (ttitle != "Program Manager" || proc != "Explorer.EXE") && class != "#32770") | |
win.Push(wins%A_Index%) | |
} | |
WinActivate, % "ahk_id " win[win.Count()] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment