Skip to content

Instantly share code, notes, and snippets.

@mattheworres
Created March 6, 2024 18:51
Show Gist options
  • Save mattheworres/e6a98b00f5a93a6bf3514a872b0d1ed0 to your computer and use it in GitHub Desktop.
Save mattheworres/e6a98b00f5a93a6bf3514a872b0d1ed0 to your computer and use it in GitHub Desktop.
AutoHotKey v2 Script to cycle through all windows of the currently focused process
; Define a hotkey (Windows key + backtick)
#`::
; Get the process ID (PID) of the active window
WinGet, activePID, PID, A
; Enumerate all windows with the same process ID
WinGet, windows, List, ahk_pid %activePID%
; If there are at least two windows, switch focus to the second one
if (windows > 1) {
WinActivate, ahk_id %windows2%
}
return
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment