HELP: Looping extract

Discussions and Tech Support specific to the iMacros Firefox add-on.
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

Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the search box (at the top of each forum page) to see if a similar problem or question has already been addressed.
3. Try searching the iMacros Wiki - it contains the complete iMacros reference as well as plenty of samples and tutorials.
4. We can respond much faster to your posts if you include the following information: CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST
Post Reply
silversoul720
Posts: 1
Joined: Sun Jan 01, 2017 4:38 am

HELP: Looping extract

Post by silversoul720 » Sun Jan 01, 2017 5:24 am

Build1: Windows 7, v.9.0.3, Firefox 50 | Build2: Windows 7, v.8.9.7, Firefox 46

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");
}

}
Tried with the 2 builds mentioned on top, same issues for both.
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.
Post Reply