Reverse the order apps cycled?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
ahkonfused
Posts: 9
Joined: 29 Jun 2022, 21:22

Reverse the order apps cycled?

Post by ahkonfused » 02 Jul 2022, 20:15

I want to run this script to rotate between windows of the active app. But as constructed it cycles the least recent first.
How would I edit it to do the opposite and get the most recent window first?

Code: Select all

  
   !`::
   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


Post Reply

Return to “Ask for Help (v1)”