Jump to content
Sign in to follow this  


Recommended Posts



I'v e very new to the suto it application. I was trying to create a script that would Alt-Tab between two IE browsers every 1 min. Does any happen to have the code already developed for it? or somethign close that I could tweak. I'm guessign it isn;t that hard, some sort of for loop witha timer or something along those lines. Or perhaps there is even an easier way. Please help.

what would the syntex be?

Share this post

Link to post
Share on other sites

Modify this script with the exact wording in the titlebar. As you can see, I use Firefox. But it will work in Internet Explorer, too.

While 1
    WinActivate("Google - Mozilla Firefox")
    Sleep (60000) ; 60000 ms = 1 minute
    WinActivate("Help - AutoIt Forums - Mozilla Firefox")

#include <ByteMe.au3>

Share this post

Link to post
Share on other sites

This should do what you want (works with any number of IE windows, though not tabs)

AutoItSetOption("trayicondebug", 1) ;lets you mouse over tray icon to see what line of the code the script is on
HotKeySet('{esc}',"Terminate") ;sets esc key to function
AutoItSetOption("WinTitleMatchMode",2) ;sets window search to part of window name instead of full match
$IE_List = WinList("Windows Internet Explorer") ;creates an array with all windows matching "Windows Internet Explorer"
$i = 1
$timer = TimerInit() ;starts a timer
WinActivate($IE_List[$i][1]) ;activates the first match in the array
$i+=1 ;increases $i by 1
While 1 ;starts unending loop
 If $i > Int($IE_List[0][0]) Then ;checks if $i is greater than total number of IE windows
  $i = 1 ;sets$i back to 1 if it is
 If TimerDiff($timer) > 60000 Then ;checks the timer if 1 minute has passed
  WinActivate($IE_List[$i][1]) ;if yes, activate the next IE window
  $i += 1 ;add 1 to $i
  $timer = TimerInit() ;reset the timer
Func Terminate() ;if esc is pressed
 Exit ;exit the script


for some reason, I thought it was every 2 minutes

**edit 2**

added comments to the code so you knnow what it is doing

Edited by kaotkbliss



My Android cat and mouse game

We're gonna need another Timmy!

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this