HELP: Looping extract

Discussions and Tech Support related to the iMacros Firefox Add-on, including the built-in Javascript scripting interface for playing .js files.

Moderators: Community Moderators, iMacros Moderators

Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the Google search box (at the top of each forum page) to see if a similar problem or question has already been addressed. This will search the entire contents of the forums as well as the iMacros Wiki.
3. We can respond much faster to your posts if you include the following information:

CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST

Answering your own posts (e.g. attempting to "bump" your topic) drops your topic from the list of unanswered threads, so it may actually receive less views.

HELP: Looping extract

by silversoul720 on Sat Dec 31, 2016 10:24 pm

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.
silversoul720
 
Posts: 1
Joined: Sat Dec 31, 2016 9:38 pm

Return to iMacros for Firefox

Who is online

Users browsing this forum: No registered users and 9 guests

-->