Java script loop help

#1
outputdrive = "d:\\temp\\";

saveimage = outputdrive;

var oAB = WScript.CreateObject("Broker.Application");


ADS = oAB.Documents;

// Do not exceed number of active chart tabs.
// So if there are 3 chart tabs then max. number of Items is three, (0) to (3)

ADS.Item(0).ActiveWindow.ExportImage( "D:\\TEMP\\BANKNIFTY.png", 1000, 560);
ADS.Item(1).ActiveWindow.ExportImage( "D:\\TEMP\\NIFTY.png", 1000, 560);
ADS.Item(2).ActiveWindow.ExportImage( "D:\\TEMP\\TATASTEEL.png", 1000, 560);


Above codes are working fine in java script.

I want to to run above codes for 35 script hence i want to use loop
any one can tell me how to put above codes in loop
so that active charts will be saved in drive c:\temp\
 
#3
does your ADS object has 35 records? i mean do you want to just loop below line 35 times with name of script changed?

ADS.Item(0).ActiveWindow.ExportImage( "D:\\TEMP\\BANKNIFTY.png", 1000, 560);

Ads. Item()

Should be variable

And png file name shld be active script name.

So I don't need to type 35 script name.
 

Similar threads