Loop Datasource

Discussions and Tech Support specific to the iMacros Firefox add-on.
Forum rules
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
techimac
Posts: 318
Joined: Fri Feb 20, 2015 9:27 pm

Re: Loop Datasource

Post by techimac » Tue Sep 12, 2017 6:10 pm

By +1, I mean increment by 1
JohnnyMaus0912
Posts: 12
Joined: Thu Sep 07, 2017 3:29 pm

Re: Loop Datasource

Post by JohnnyMaus0912 » Tue Sep 12, 2017 6:58 pm

Could you give me an example? Is this right with the code?


EDIT:
Could someone help me?

Code: Select all

var Macro = "";
Macro += "CODE:" + "\n";
Macro += "SET !ERRORIGNORE YES" + "\n";
Macro += "SET !DATASOURCE homepage.csv" + "\n";
Macro += "SET !DATASOURCE_COLUMNS 1" + "\n";
Macro += "SET !DATASOURCE_LINE {{LOOPNUM}}" + "\n";
Macro += "SET !TIMEOUT_PAGE 60" + "\n";
Macro += "WAIT SECONDS = 800" + "\n";
Macro += "URL GOTO=.........................................{{!COL1}}" + "\n";
Macro += "WAIT SECONDS = 800" + "\n";

var Macro1 = "";
Macro += "CODE:" + "\n";
Macro += "SET !ERRORIGNORE YES" + "\n";
Macro += "SET !DATASOURCE Shisha.csv" + "\n";
Macro += "SET !DATASOURCE_COLUMNS 1" + "\n";
Macro += "SET !DATASOURCE_LINE {{LOOPNUM}}" + "\n";
Macro += "SET !TIMEOUT_PAGE 60" + "\n";
Macro += "WAIT SECONDS = 800" + "\n";
Macro += "TAG POS=1 TYPE=DIV ATTR=CLASS:{{COL1}}" + "\n";
Macro += "WAIT SECONDS = 800" + "\n";

for(var x=1;x>0;x++)
{

for(var loop=1;loop<3;loop++)
{
        iimSet("LOOPNUM",loop)
        iimPlay(Macro);
}

}

for(var x=1;x>0;x++)
{
for(var loop=1;loop<3;loop++)
{
        iimSet("LOOPNUM",loop)
        iimPlay(Macro1);
}

}
techimac
Posts: 318
Joined: Fri Feb 20, 2015 9:27 pm

Re: Loop Datasource

Post by techimac » Fri Sep 15, 2017 8:43 pm

what are you trying to do?
JohnnyMaus0912
Posts: 12
Joined: Thu Sep 07, 2017 3:29 pm

Re: Loop Datasource

Post by JohnnyMaus0912 » Sat Sep 16, 2017 10:46 am

I wanted to have two datasource in a macro. And the second, should work just like the first. When both have gone through, just start over again. But I think I'm too stupid for it. :|
techimac
Posts: 318
Joined: Fri Feb 20, 2015 9:27 pm

Re: Loop Datasource

Post by techimac » Sat Sep 16, 2017 5:04 pm

var Macro1 = "";
Macro += "CODE:" + "\n";
Macro += "SET !ERRORIGNORE YES" + "\n";
Macro += "SET !DATASOURCE Shisha.csv" + "\n";

you need to use Macro1in other lines as well
JohnnyMaus0912
Posts: 12
Joined: Thu Sep 07, 2017 3:29 pm

Re: Loop Datasource

Post by JohnnyMaus0912 » Sun Sep 17, 2017 3:05 am

But I did this, in the code I have set up above. :cry:
var Macro = "";
Macro += "CODE:" + "\n";
Macro += "SET !ERRORIGNORE YES" + "\n";
Macro += "SET !DATASOURCE homepage.csv" + "\n";
Macro += "SET !DATASOURCE_COLUMNS 1" + "\n";
Macro += "SET !DATASOURCE_LINE {{LOOPNUM}}" + "\n";
Macro += "SET !TIMEOUT_PAGE 60" + "\n";
Macro += "WAIT SECONDS = 800" + "\n";
Macro += "URL GOTO=.........................................{{!COL1}}" + "\n";
Macro += "WAIT SECONDS = 800" + "\n";

var Macro1 = "";
Macro += "CODE:" + "\n";
Macro += "SET !ERRORIGNORE YES" + "\n";
Macro += "SET !DATASOURCE Shisha.csv" + "\n";
Macro += "SET !DATASOURCE_COLUMNS 1" + "\n";
Macro += "SET !DATASOURCE_LINE {{LOOPNUM}}" + "\n";
Macro += "SET !TIMEOUT_PAGE 60" + "\n";
Macro += "WAIT SECONDS = 800" + "\n";
Macro += "TAG POS=1 TYPE=DIV ATTR=CLASS:{{COL1}}" + "\n";
Macro += "WAIT SECONDS = 800" + "\n";

for(var x=1;x>0;x++)
{

for(var loop=1;loop<3;loop++)
{
iimSet("LOOPNUM",loop)
iimPlay(Macro);
}

}

for(var x=1;x>0;x++)
{
for(var loop=1;loop<3;loop++)
{
iimSet("LOOPNUM",loop)
iimPlay(Macro1);
}
techimac
Posts: 318
Joined: Fri Feb 20, 2015 9:27 pm

Re: Loop Datasource

Post by techimac » Sun Sep 17, 2017 3:54 am

var Macro1 = "";
Macro += "CODE:" + "\n";
Macro += "SET !ERRORIGNORE YES" + "\n";
Macro += "SET !DATASOURCE Shisha.csv" + "\n";
Macro += "SET !DATASOURCE_COLUMNS 1" + "\n";
Macro += "SET !DATASOURCE_LINE {{LOOPNUM}}" + "\n";
Macro += "SET !TIMEOUT_PAGE 60" + "\n";
Macro += "WAIT SECONDS = 800" + "\n";
Macro += "TAG POS=1 TYPE=DIV ATTR=CLASS:{{COL1}}" + "\n";
Macro += "WAIT SECONDS = 800" + "\n";

should be

var Macro1 = "";
Macro1 += "CODE:" + "\n";
Macro1 += "SET !ERRORIGNORE YES" + "\n";
Macro1 += "SET !DATASOURCE Shisha.csv" + "\n";
Macro1 += "SET !DATASOURCE_COLUMNS 1" + "\n";
Macro1 += "SET !DATASOURCE_LINE {{LOOPNUM}}" + "\n";
Macro1 += "SET !TIMEOUT_PAGE 60" + "\n";
Macro1 += "WAIT SECONDS = 800" + "\n";
Macro1 += "TAG POS=1 TYPE=DIV ATTR=CLASS:{{COL1}}" + "\n";
Macro1 += "WAIT SECONDS = 800" + "\n";
techimac
Posts: 318
Joined: Fri Feb 20, 2015 9:27 pm

Re: Loop Datasource

Post by techimac » Sun Sep 17, 2017 3:55 am

I have fixed code syntax but it might not do what you are trying
once url opens what you want to do?
JohnnyMaus0912
Posts: 12
Joined: Thu Sep 07, 2017 3:29 pm

Re: Loop Datasource

Post by JohnnyMaus0912 » Sun Sep 17, 2017 1:23 pm

If I start the macro now, then he does not recognize the second macro at all. It only plays the first macro from the script.

I hope I explain this understandably. On my homepage there are several categories of shishas, these are to be opened with the first macro gradually. Once he is in one of these categories, he should open the individual images. The pictures are named in the same category, therefore also as a data source.
Did you understand that? :cry:

Therefore, both data sources should loop.
techimac
Posts: 318
Joined: Fri Feb 20, 2015 9:27 pm

Re: Loop Datasource

Post by techimac » Sun Sep 17, 2017 6:48 pm

send web page address
chivracq
Posts: 9374
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Loop Datasource

Post by chivracq » Sun Sep 17, 2017 8:50 pm

techimac wrote:send web page address
:twisted:
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
techimac
Posts: 318
Joined: Fri Feb 20, 2015 9:27 pm

Re: Loop Datasource

Post by techimac » Mon Sep 18, 2017 10:16 am

I have changed the code

Code: Select all

var Macro = "";
Macro += "CODE:" + "\n";
Macro += "SET !ERRORIGNORE YES" + "\n";
Macro += "SET !DATASOURCE homepage.csv" + "\n";
Macro += "SET !DATASOURCE_COLUMNS 1" + "\n";
Macro += "SET !DATASOURCE_LINE {{LOOPNUM}}" + "\n";
Macro += "SET !TIMEOUT_PAGE 60" + "\n";
Macro += "WAIT SECONDS = 800" + "\n";
Macro += "URL GOTO=.........................................{{!COL1}}" + "\n";
Macro += "WAIT SECONDS = 800" + "\n";

var Macro1 = "";
Macro1 += "CODE:" + "\n";
Macro1 += "SET !ERRORIGNORE YES" + "\n";
Macro1 += "SET !DATASOURCE Shisha.csv" + "\n";
Macro1 += "SET !DATASOURCE_COLUMNS 1" + "\n";
Macro1 += "SET !DATASOURCE_LINE {{LOOPNUM}}" + "\n";
Macro1 += "SET !TIMEOUT_PAGE 60" + "\n";
Macro1 += "WAIT SECONDS = 800" + "\n";
Macro1 += "TAG POS=1 TYPE=DIV ATTR=CLASS:{{COL1}}" + "\n";
Macro1 += "WAIT SECONDS = 800" + "\n";

for(var x=1;x>0;x++)
{

for(var loop=1;loop<3;loop++)
{
iimSet("LOOPNUM",loop)
iimPlay(Macro);

for(var loop=1;loop<3;loop++)
{
iimSet("LOOPNUM",loop)
iimPlay(Macro1);
}

}

}

JohnnyMaus0912
Posts: 12
Joined: Thu Sep 07, 2017 3:29 pm

Re: Loop Datasource

Post by JohnnyMaus0912 » Mon Sep 18, 2017 6:22 pm

techimac wrote:I have changed the code

Code: Select all

var Macro = "";
Macro += "CODE:" + "\n";
Macro += "SET !ERRORIGNORE YES" + "\n";
Macro += "SET !DATASOURCE homepage.csv" + "\n";
Macro += "SET !DATASOURCE_COLUMNS 1" + "\n";
Macro += "SET !DATASOURCE_LINE {{LOOPNUM}}" + "\n";
Macro += "SET !TIMEOUT_PAGE 60" + "\n";
Macro += "WAIT SECONDS = 800" + "\n";
Macro += "URL GOTO=.........................................{{!COL1}}" + "\n";
Macro += "WAIT SECONDS = 800" + "\n";

var Macro1 = "";
Macro1 += "CODE:" + "\n";
Macro1 += "SET !ERRORIGNORE YES" + "\n";
Macro1 += "SET !DATASOURCE Shisha.csv" + "\n";
Macro1 += "SET !DATASOURCE_COLUMNS 1" + "\n";
Macro1 += "SET !DATASOURCE_LINE {{LOOPNUM}}" + "\n";
Macro1 += "SET !TIMEOUT_PAGE 60" + "\n";
Macro1 += "WAIT SECONDS = 800" + "\n";
Macro1 += "TAG POS=1 TYPE=DIV ATTR=CLASS:{{COL1}}" + "\n";
Macro1 += "WAIT SECONDS = 800" + "\n";

for(var x=1;x>0;x++)
{

for(var loop=1;loop<3;loop++)
{
iimSet("LOOPNUM",loop)
iimPlay(Macro);

for(var loop=1;loop<3;loop++)
{
iimSet("LOOPNUM",loop)
iimPlay(Macro1);
}

}

}

Thanks alot. Works almost as I wanted it. The homepage is not yet ready, try only at a subdomain. :cry: The only problem, he remains in "Macro1" and does not jump back to "Macro".
techimac
Posts: 318
Joined: Fri Feb 20, 2015 9:27 pm

Re: Loop Datasource

Post by techimac » Mon Sep 18, 2017 7:57 pm

Code: Select all

var Macro = "";
Macro += "CODE:" + "\n";
Macro += "SET !ERRORIGNORE YES" + "\n";
Macro += "SET !DATASOURCE homepage.csv" + "\n";
Macro += "SET !DATASOURCE_COLUMNS 1" + "\n";
Macro += "SET !DATASOURCE_LINE {{LOOPNUM}}" + "\n";
Macro += "SET !TIMEOUT_PAGE 60" + "\n";
Macro += "WAIT SECONDS = 800" + "\n";
Macro += "URL GOTO=.........................................{{!COL1}}" + "\n";
Macro += "WAIT SECONDS = 800" + "\n";


var Macro1 = "";
Macro1 += "CODE:" + "\n";
Macro1 += "SET !ERRORIGNORE YES" + "\n";
Macro1 += "SET !DATASOURCE Shisha.csv" + "\n";
Macro1 += "SET !DATASOURCE_COLUMNS 1" + "\n";
Macro1 += "SET !DATASOURCE_LINE {{LOOPNUM}}" + "\n";
Macro1 += "SET !TIMEOUT_PAGE 60" + "\n";
Macro1 += "WAIT SECONDS = 800" + "\n";
Macro1 += "TAG POS=1 TYPE=DIV ATTR=CLASS:{{!COL1}}" + "\n";
Macro1 += "WAIT SECONDS = 800" + "\n";

for(var x=1;x>0;x++)
{

for(var loop=1;loop<3;loop++)
{
iimSet("LOOPNUM",loop)
iimPlay(Macro);

for(var loop1=1;loop1<3;loop1++)
{
iimSet("LOOPNUM",loop1)
iimPlay(Macro1);
}

}

}

Post Reply