Automate all available tabs (in sequence)

Post Reply
Hannes, Tech Support

Automate all available tabs (in sequence)

Post by Hannes, Tech Support » Wed Jan 13, 2010 6:54 am

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.")
Post Reply