The hotkey is (Alt + ~)
The "type" checking is based on the App's Title convention that stipulates that the App name should be at the end of the Window title (Eg: New Document - Word )
It works well with regular Window Apps, Chrome Shortcuts and Chrome Apps
Code: Select all
/* ;
*****************************
***** UTILITY FUNCTIONS *****
*****************************
*/
ExtractAppTitle(FullTitle)
{
AppTitle := SubStr(FullTitle, InStr(FullTitle, " ", false, -1) + 1)
Return AppTitle
}
/* ;
***********************************
***** SHORTCUTS CONFIGURATION *****
***********************************
*/
; Alt + ` - Activate NEXT Window of same type (title checking) of the current APP
!`::
WinGet, ActiveProcess, ProcessName, A
WinGet, OpenWindowsAmount, Count, ahk_exe %ActiveProcess%
If OpenWindowsAmount = 1 ; If only one Window exist, do nothing
Return
Else
{
WinGetTitle, FullTitle, A
AppTitle := ExtractAppTitle(FullTitle)
SetTitleMatchMode, 2
WinGet, WindowsWithSameTitleList, List, %AppTitle%
If WindowsWithSameTitleList > 1 ; If several Window of same type (title checking) exist
{
WinActivate, % "ahk_id " WindowsWithSameTitleList%WindowsWithSameTitleList% ; Activate next Window
}
}
Return
Note: The Source Code with the last actualization can be found here https://github.com/JuanmaMenendez/AutoHotkey-script-Open-Show-Apps/blob/master/AutoHotkey-script-Switch-Windows-same-App.ahk
*** Extra ***
Also, I have another script that could work well in tandem with this one because you will be able to Open, Restore or Minimize (if it is already opened) the desired Apps, using the shortcuts key (hotkeys) that you want to set. Examples:
F7:: OpenOrShowAppBasedOnExeName("C:\Windows\System32\SnippingTool.exe")
F8:: OpenOrShowAppBasedOnWindowTitle("Gmail", "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe --app=https mail.google.com /mail/") Broken Link for safety
Feel free to check my repo and give me your thoughts
https://github.com/JuanmaMenendez/AutoHotkey-script-Open-Show-Apps
Thanks