I am using Firefox, iMacros and js.
I have a URLs.txt-file with a list of URLs. In Firefox I have a webpage open in Tab 1. This website contains many URLs. Some of which are in my text file. I am trying to create a simple script that will skip the URLs from my text file and open the other URLs each in the next tabs. 10 at once. So Tab 2-11 should be opened with new URLs that are not in my text file. This is my JavaScript, but it doesn't work:
var macro;
var ret;
macro ="CODE:";
macro +="SET !DATASOURCE URLs.txt"+"\n"
macro +="SET !ERRORIGNORE YES"+"\n";
macro +="TAG POS=1 TYPE=HTML ATTR=* EXTRACT=HTM"+"\n";
macro +="SET !DATASOURCE_LINE {{!LOOP}}"+"\n";
iimPlay(macro)
var text=iimGetExtract();
if(text.search("00016")!=-1) {
ret = iimPlay("donothing.iim");
}
else if (ret != -101) {
ret = iimPlay("openURL.iim");
}
openURL.iim simply opens tabs with URLs, but in this script it never skips those URLs that are in my list. I need help to fix this code.
this is what openURL.iim looks like (for the first 4 tabs):
VERSION BUILD=9030808 RECORDER=FX
TAB T=1
EVENT TYPE=CLICK SELECTOR="HTML>BODY>UL:nth-of-type(2)>LI>A" BUTTON=0 MODIFIERS="ctrl"
EVENT TYPE=CLICK SELECTOR="HTML>BODY>UL:nth-of-type(2)>LI:nth-of-type(2)>A" BUTTON=0 MODIFIERS="ctrl"
EVENT TYPE=CLICK SELECTOR="HTML>BODY>UL:nth-of-type(2)>LI:nth-of-type(3)>A" BUTTON=0 MODIFIERS="ctrl"
EVENT TYPE=CLICK SELECTOR="HTML>BODY>UL:nth-of-type(2)>LI:nth-of-type(4)>A" BUTTON=0 MODIFIERS="ctrl"
EVENT TYPE=CLICK SELECTOR="HTML>BODY>UL:nth-of-type(2)>LI:nth-of-type(5)>A" BUTTON=0 MODIFIERS="ctrl"
....