Automate all available tabs (in sequence)

Forum rules
iMacros EOL - Attention!

The renewal maintenance has officially ended for Progress iMacros effective November 20, 2023 and all versions of iMacros are now considered EOL (End-of-Life). The iMacros products will no longer be supported by Progress (aside from customer license issues), and these forums will also no longer be moderated from the Progress side.

Thank you again for your business and support.

Sincerely,
The Progress Team
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