Automate all available tabs (in sequence)

Moderator: iMacros Moderators

Automate all available tabs (in sequence)

by Hannes, Tech Support on Tue Jan 12, 2010 11:54 pm

Here's how to "work through all available tabs", running a certain macro in each of them. The script starts at the active tab.
Code: Select all
var iret = 1
var firstrun = true
var tabcounter = 0
/* here comes the loop */
/* automating each "next" tab */
/* as long as a next tab is found*/
while ( iret >=0 )
{
   tabcounter ++;
   iimDisplay("loop# " + tabcounter);
   macro =  "CODE:";
   if (firstrun)
   {
      /* don't switch tabs in first loop*/
      firstrun = false;
   }
   else
   {
      /* select next tab */
      macro += "TAB T=2" + "\n";
   }
   macro += "URL GOTO=http://www.iopus.com" + "\n";
   iret = iimPlay(macro)   
}
alert ("End of tabs reached.")
Hannes, iOpus Support
Hannes, Tech Support
 
Posts: 2120
Joined: Thu Sep 21, 2006 6:27 am

Return to How-To's and Examples for Firefox / JavaScript Scripting

Who is online

Users browsing this forum: No registered users and 1 guest

-->