Run in automatically a macro iim with loop

Discussions and Tech Support related to the iMacros Firefox Add-on, including the built-in Javascript scripting interface for playing .js files.
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
Post Reply
provoquestosito
Posts: 75
Joined: Sat Jan 30, 2010 12:43 am

Run in automatically a macro iim with loop

Post by provoquestosito » Sun Sep 22, 2019 5:37 pm

Hi

It's possibile to run a macro in iim with a loop ?

Now i manually add the loop number and click manually the button to start the loop.

Exist a solution to run in automatically 10 times a macro in pure iim ?

in javascript I can create a loop but i prefer iim because it's more stable.

When i run a macro via batch file i can not find a solution for loop automatically in iim macro.

In javascript i embed iim macro to run loop automatically

Code: Select all

iimPlay('macro.iim');
iimPlay('macro.iim');
iimPlay('macro.iim');
Exist a solution for iim macro to do a loop automatically ?

In iim macro unique solution that i find is copy the code of macro more times but sometimes it is long and hard to edit after and create a code confused.

UPDATE: Firefox 56 (or firefox ESR 52) Windows 7 32 Bit In Italian Imacros 8.9.7 For Firefox (sorry for delay)

Thanks
Last edited by provoquestosito on Sat Sep 28, 2019 5:04 pm, edited 1 time in total.
rstancuna
Posts: 23
Joined: Sun Jun 16, 2019 10:27 pm

Re: Run in automatically a macro iim with loop

Post by rstancuna » Tue Sep 24, 2019 9:07 pm

Most likely not possible the way you want through pure iim. You could use EVAL but it's not pure iim since it would use javascript, check this topic.

To add to your javascript code, just create an actual loop instead of copy pasting the iimPlay function:

Code: Select all

times_to_run=3;

for (var i=0; i < times_to_run; i++){
  iimPlay('macro.iim');
}
Waterfox 56.2, iMacros V8.9.7 on Windows
chivracq
Posts: 8716
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Run in automatically a macro iim with loop

Post by chivracq » Tue Sep 24, 2019 9:57 pm

provoquestosito wrote:
Sun Sep 22, 2019 5:37 pm
Hi

It's possibile to run a macro in iim with a loop ?

Now i manually add the loop number and click manually the button to start the loop.

Exist a solution to run in automatically 10 times a macro in pure iim ?

in javascript I can create a loop but i prefer iim because it's more stable.

When i run a macro via batch file i can not find a solution for loop automatically in iim macro.

In javascript i embed iim macro to run loop automatically

Code: Select all

iimPlay('macro.iim');
iimPlay('macro.iim');
iimPlay('macro.iim');
Exist a solution for iim macro to do a loop automatically ?

In iim macro unique solution that i find is copy the code of macro more times but sometimes it is long and hard to edit after and create a code confused.

Thanks
rstancuna wrote:
Tue Sep 24, 2019 9:07 pm
Most likely not possible the way you want through pure iim. You could use EVAL but it's not pure iim since it would use javascript, check this topic.

To add to your javascript code, just create an actual loop instead of copy pasting the iimPlay function:

Code: Select all

times_to_run=3;

for (var i=0; i < times_to_run; i++){
  iimPlay('macro.iim');
}
rstancuna wrote:
Tue Sep 24, 2019 9:07 pm
Most likely not possible the way you want through pure iim.
Yep it is, 2 ways, +3 other ways a bit "cumbersome" and that require a bit of "Preparation" and a bit of JS..., and +4 again other ways that are even more cumbersome... :wink:
rstancuna wrote:
Tue Sep 24, 2019 9:07 pm
You could use EVAL but it's not pure iim since it would use javascript, check this topic.
Won't work for what @OP wants... The Macro needs to be already looping for this Technique to work...
- (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...
rstancuna
Posts: 23
Joined: Sun Jun 16, 2019 10:27 pm

Re: Run in automatically a macro iim with loop

Post by rstancuna » Tue Sep 24, 2019 10:22 pm

chivracq wrote:
Tue Sep 24, 2019 9:57 pm
rstancuna wrote:
Tue Sep 24, 2019 9:07 pm
Most likely not possible the way you want through pure iim.
Yep it is, 2 ways, +3 other ways a bit "cumbersome" and that require a bit of "Preparation" and a bit of JS..., and +4 again other ways that are even more cumbersome... :wink:
There doesn't seem to be any command for max number of loops and no way to start a loop via pure iim (without any javascript) without clicking the loop button. I've always considered iim code too limiting (compared to js+iim) when it comes to loops or conditional statements so i never looked too deep into it since javascript could do everything i needed and it seems easier to maintain and read.

Code: Select all

URL GOTO=https://www.google.com/
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:tsf ATTR=NAME:q CONTENT=example
TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:tsf ATTR=NAME:btnK
TAB OPEN
TAB T=2
What ways are there to loop this iim code, but using just iim and without using the loop button from iMacros window ?
Waterfox 56.2, iMacros V8.9.7 on Windows
User avatar
thecoder2012
Posts: 358
Joined: Sat Aug 15, 2015 5:14 pm
Location: Internet
Contact:

Re: Run in automatically a macro iim with loop

Post by thecoder2012 » Tue Sep 24, 2019 11:29 pm

rstancuna wrote:
Tue Sep 24, 2019 10:22 pm
What ways are there to loop this iim code, but using just iim and without using the loop button from iMacros window ?
Protocol handler with URL GOTO=imacros://run/?m=yourfile.iim
Endless loop! :lol:
Join 9kw.eu Captcha Service now and let your iMacros continue downloads and scripts while you sleep. - Custom iMacros? Contact me! :idea:
rstancuna
Posts: 23
Joined: Sun Jun 16, 2019 10:27 pm

Re: Run in automatically a macro iim with loop

Post by rstancuna » Tue Sep 24, 2019 11:40 pm

thecoder2012 wrote:
Tue Sep 24, 2019 11:29 pm
Protocol handler with URL GOTO=imacros://run/?m=yourfile.iim
Endless loop! :lol:
:lol: Never tried to run it like that. Any way to set how many times it should run ?
Waterfox 56.2, iMacros V8.9.7 on Windows
User avatar
thecoder2012
Posts: 358
Joined: Sat Aug 15, 2015 5:14 pm
Location: Internet
Contact:

Re: Run in automatically a macro iim with loop

Post by thecoder2012 » Tue Sep 24, 2019 11:50 pm

rstancuna wrote:
Tue Sep 24, 2019 11:40 pm
:lol: Never tried to run it like that. Any way to set how many times it should run ?
I think with pure iim (without any javascript/eval or workarounds/addons) not really.
Join 9kw.eu Captcha Service now and let your iMacros continue downloads and scripts while you sleep. - Custom iMacros? Contact me! :idea:
chivracq
Posts: 8716
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Run in automatically a macro iim with loop

Post by chivracq » Wed Sep 25, 2019 12:28 am

thecoder2012 wrote:
Tue Sep 24, 2019 11:50 pm
rstancuna wrote:
Tue Sep 24, 2019 11:40 pm
thecoder2012 wrote:
Tue Sep 24, 2019 11:29 pm
Protocol handler with URL GOTO=imacros://run/?m=yourfile.iim
Endless loop! :lol:
:lol: Never tried to run it like that. Any way to set how many times it should run ?
I think with pure iim (without any javascript/eval or workarounds/addons) not really.
OK, I didn't want to post any "Solution" until @OP had mentioned their FCI, but yep indeed, that's one of the 2 ways I was referring to. 8)

And the Loop_Max can be set using some Temp File or the OS-Clipboard to keep track of the current Loop_Nb and abort the Script using 'EVAL()' + 'MacroError()' or any of the different ways to stop a Macro.

>>>

Now for the 2nd way in pure-pure-pure '.iim' (no JS, no 'EVAL()' needed...), I won't post it (even if @OP mentions their FCI), as it relies on a Bug that I would prefer @Dev not to fix, so I don't "advertize" about it... (but I would think @thecoder probably knows it...) Even if I don't think I will ever "update" to v10.x for FF (but you never know...!), and I never checked if it still works in v10.0.2 for FF.
- (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...
provoquestosito
Posts: 75
Joined: Sat Jan 30, 2010 12:43 am

Re: Run in automatically a macro iim with loop

Post by provoquestosito » Sat Sep 28, 2019 4:56 pm

Hi to all

Actually i never find any solution different create a js macro.

I'm not interested solution in pure iim but solution saved in a iim file (not .js macro).

Any suggestion was appreciated.
Post Reply