Hi!
I'm new to this forum so I apologise first hand if this is somehow a duplicate post, I searched for a while but couldn't find the solution I was looking for.
I've no knowledge in coding whatsoever and I'm trying to make a macro that 'scans' a certain area of a page with EXTRACT then IF a single word within a specific group of words (name1,name2,etc...) is found, it sends me to an URL and stops running.
If none of those words are found, I want the macro to click on a certain image link that will refresh the area to be extracted and then I want it to start over and repeat forever until one of the words I'm looking for is found.
I've encountered 3 issues:
1 - Without the loop ( while(true) ), the 'scan' doesn't work on the first try, ignores the word even if its there. However it works on the second try. So it always requires me to manually run the macro twice to detect what's actually in the extracted area.
2 - Again without the loop, if I add "iimPlay(extract)" on the bottom of the macro it never works. Always ignores the words even when they are there. I've heard !EXTRACT erases itself upon the next iimPlay but it seems to erase it before the 'scan' occurs even though its written bellow it.
3 - With the loop, it works exactly the same as in the 2nd issue.
This is what I currently have:
Code: Select all
var G_Extract = iimGetExtract();
var extract;
extract = "CODE:";
extract += "SET !ERRORIGNORE YES"+"\n";
extract += "TAG POS=1 TYPE=TABLE ATTR=XXXXX:* EXTRACT=HTM"+"\n";
var found;
found = "CODE:";
found += "SET !ERRORIGNORE YES"+"\n";
found += "TAB T=1\nURL GOTO=XXXXX" + "\n";
var xscroll;
xscroll = "CODE:";
xscroll += "SET !ERRORIGNORE YES"+"\n";
xscroll += "TAG POS=1 TYPE=IMG ATTR=SRC:XXXXX" + "\n";
//------------------------------------------------------
while(true){
iimPlay(extract)
if (G_Extract.indexOf("name1")>-1)
{
iimPlay(found)
iimClose()
}
if (G_Extract.indexOf("name2")>-1)
{
iimPlay(found)
iimClose()
}
if (G_Extract.indexOf("name3")>-1)
{
iimPlay(found)
iimClose()
}
if (G_Extract.indexOf("noname")>-1)
//'noname' shows up every time the names Im looking for do not show up
{
iimPlay(xscroll)
iimPlay("CODE:WAIT SECONDS=1");
}
}
I've spent several hours trying to figure this out alone with countless approaches and all in vain, so please give me an helping hand if what I'm trying to do is even possible in the first place.