; ============================================================ ; CycleWindowsSameApp.ahk ; ; Alt+` cycles through open windows of the SAME application as the ; currently active window (similar to macOS Cmd+`). ; ; Requirements: AutoHotkey v2 (https://www.autohotkey.com/) ; ============================================================ #Requires AutoHotkey v2.0 !`::{ activeExe := WinGetProcessName("A") activeId := WinGetID("A") windows := WinGetList("ahk_exe " activeExe) if (windows.Length <= 1) return foundCurrent := false for id in windows { if (foundCurrent) { WinActivate("ahk_id " id) return } if (id = activeId) foundCurrent := true } ; wrapped around — activate the first window in the list WinActivate("ahk_id " windows[1]) }