Cycle Win Taskbar tabs in order win11

Post your working scripts, libraries and tools for AHK v1.1 and older
User avatar
Stinkfoot9
Posts: 51
Joined: 29 May 2022, 12:17

Cycle Win Taskbar tabs in order win11

31 Aug 2022, 20:49

Cycle windows taskbar tabs in order using Pixelsearch to find current tab underline, and using win hotkeys #5/6/7/8/9/0 to cycle

Code: Select all


CoordMode, Pixel, Screen

par1 = #9,#8,#7,#6 ; Win11 Tab Hotkey

^left::
	PixelSearch, ovx1, ovy, 181, 1024, 1335, 1079, 0xff8b00  , 2, fast rgb  ; Find Active Tab via undeline win Color, report position to use below. Use winspy to find color code.
	Sleep 100
	Wingettitle, LWA1, A
	If (ovx1 = 197) ; Use Winspy to get underline pos
		Send, #0
	If (ovx1 = 397)
		Send, #5
	If (ovx1 = 597)
		Send, #6
	If (ovx1 = 797)
		Send, #7
	If (ovx1 = 997)
		{
		Send, #8
		}
	Sleep 50	
	Wingettitle, LWA2, A  
	If (LWA1 = LWA2) ; If No Tab Change due to next immediate tab not existing.
		{
		Loop, parse, par1, `,
			{
			Send,%A_loopfield%
			Wingettitle, PLWA, a
			IF (LWA1 != PLWA) ; Stop Cycle when Active win has changed.
				{
				Break                           
				}
			}
		} 
return 

^Right::
	PixelSearch, ovx, ovy, 181, 1024, 1335, 1079, 0xff8b00  , 2, fast rgb
	Sleep 100
	Wingettitle, RWA1, A
	If (ovx = 197)
		{
		Send, #6
		return
		}		
	If (ovx = 397)
		Send, #7
	If (ovx = 597)
		Send, #8
	If (ovx = 797)
		Send, #9
	If (ovx = 997)
		{
		Send, #0
		}
	Sleep 50	
	Wingettitle, RWA2, A ;If No Tab Change due to next immediate tab not existing go back to 1st tab.
	If (RWA1 = RWA2)
		{
		Send, #5
		}
return 
Attachments
2022-08-30 23_07_45-Greenshot.jpg
2022-08-30 23_07_45-Greenshot.jpg (7.12 KiB) Viewed 542 times

Return to “Scripts and Functions (v1)”

Who is online

Users browsing this forum: Chunjee and 85 guests