Script that will ALT TAB between 2 programs every 30 sec Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
danceman96
Posts: 7
Joined: 30 Nov 2021, 09:47

Script that will ALT TAB between 2 programs every 30 sec

30 Nov 2021, 09:51

Hello,
please help me create a script that when run will change the currently displayed program windows (ALT+TAB) every 1 minute.
It would be perfect to be able to choose which .exe to switch between
User avatar
mikeyww
Posts: 26931
Joined: 09 Sep 2014, 18:38

Re: Script that will ALT TAB between 2 programs every 30 sec  Topic is solved

30 Nov 2021, 11:25

Code: Select all

#Persistent
SetTimer, Change, 60000
Return
Change:
win := []
WinGet, wins, List
Loop, %wins% {
 WinGetTitle, ttitle, % winTitle := "ahk_id " wins%A_Index%
 WinGet, proc, ProcessName, %winTitle%
 SplitPath, proc,,,, proc
 WinGetClass, class, %winTitle%
 If class not contains ToolBar,#32770
  If (ttitle > "" && (ttitle != "Program Manager" || proc != "Explorer"))
   win.Push(wins%A_Index%)
} Until win.Count() = 2
WinActivate, % "ahk_id " win.2
Return
danceman96
Posts: 7
Joined: 30 Nov 2021, 09:47

Re: Script that will ALT TAB between 2 programs every 30 sec

09 Dec 2021, 02:32

mikeyww wrote:
30 Nov 2021, 11:25

Code: Select all

#Persistent
SetTimer, Change, 60000
Return
Change:
win := []
WinGet, wins, List
Loop, %wins% {
 WinGetTitle, ttitle, % winTitle := "ahk_id " wins%A_Index%
 WinGet, proc, ProcessName, %winTitle%
 SplitPath, proc,,,, proc
 WinGetClass, class, %winTitle%
 If class not contains ToolBar,#32770
  If (ttitle > "" && (ttitle != "Program Manager" || proc != "Explorer"))
   win.Push(wins%A_Index%)
} Until win.Count() = 2
WinActivate, % "ahk_id " win.2
Return
thank you very much !

it work's, however can you help me in edit it to get possibility of switching betwen more than 2 windows?
And how can i choose wich windows will be switching ?

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Google [Bot], hedehede81, ht55cd3, OrangeCat and 320 guests