Skip to content

Instantly share code, notes, and snippets.

@tonylambiris
Forked from snmishra/switcher.ahk
Created September 23, 2019 14:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tonylambiris/d9dab2d144dae4b38f0ae60c364131e7 to your computer and use it in GitHub Desktop.
Save tonylambiris/d9dab2d144dae4b38f0ae60c364131e7 to your computer and use it in GitHub Desktop.
Switch windows by process name using Alt+` and S
; Based on https://superuser.com/a/768060/542406
!`:: ; Next window
WinGet, ActiveProcessName, ProcessName, A
WinGet, WinClassCount, Count, ahk_exe %ActiveProcessName%
IF WinClassCount = 1
Return
Else
WinSet, Bottom,, A
WinActivate, ahk_exe %ActiveProcessName%
return
!+`:: ; Last window
WinGet, ActiveProcessName, ProcessName, A
WinGet, WinClassCount, Count, ahk_exe %ActiveProcessName%
IF WinClassCount = 1
Return
Else
WinActivateBottom, ahk_exe %ActiveProcessName%
return
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment