I'm using iMacros for Firefox version 8.9.7, and Firefox version 55.0.2
I have a csv or text file with 10 rows. I have the iMacro script set to loop through them and input text on a website, and it works. But when it reaches row 10, it just keeps inputting row 10 over and over again instead of restarting from row 1 again.
I'm sure it's a simple solution, something I need to SET in the script, some line of code, but I just can't find it.
I tried using csv and text file, and the same problem persists. I tried a few other things I found on the net, but nothing worked.
SET !ERRORIGNORE YES
SET !TIMEOUT_PAGE 15
SET !DATASOURCE C:\Users\Me\Documents\iMacros\Datasources\L4L1.csv
SET !LOOP 1
SET !DATASOURCE_COLUMNS 2
SET !DATASOURCE_LINE {{!LOOP}}
URL GOTO=site.com
WAIT SECONDS=5
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:login ATTR=ID:username CONTENT={{!COL1}}
WAIT SECONDS=5
SET !ENCRYPTION NO
TAG POS=1 TYPE=INPUT:PASSWORD FORM=ID:login ATTR=ID:password CONTENT={{!COL2}}
WAIT SECONDS=5
I just want the script to loop through 10 rows, and then start from row 1 again and keep going.
Answer/Solution I provided in your parallel Thread on the iMacros Forum:
https://forum.imacros.net/viewtopic.php?f=11&t=30410&p=82876#p82874
[quote=chivracq post_id=82875 time=1563846921 user_id=23592]
Could be done from a '.js' Script as you are using v8.9.7 for FF but if you already know the Nb of Rows in your '.CSV' and that Nb is fixed, then it's fairly easy to implement in pure '.iim'... (And your Script will still work in all Browsers/iMacros Versions...) 8)
=> Search the [iMacros] Forum on "nested+loop+modulo" (=> 'Modulo[10]' for you...) :idea:
(=> To apply to '!DATASOURCE_LINE' instead of using the raw '!LOOP'...)
[/quote]
[quote=chivracq post_id=82876 time=1563848234 user_id=23592]
Oh..., never mind, takes me 3 Sec to write it and you'll probably be struggling with the 10/20/30/etc Loops otherwise...: 8)
VERSION BUILD=8820413 RECORDER=FX
TAB T=1
SET Modulo_10 EVAL("var n='{{!LOOP}}'; var x,y,z; x=n%10; if(x==0){z=10;} else{z=x;}; z;")
PROMPT LOOP:<SP>_{{!LOOP}}_<BR>Modulo_10:<SP>_{{Modulo_10}}_
'SET !DATASOURCE_LINE {{Modulo_10}}
(Tested on iMacros for FF v8.8.2, PM v26.3.3, Win10_x64.) [/quote]
>
EDIT:
The Script here above in this current Answer (on this Forum) is a very "basic" Proof-of-Concept... I've posted a more generic/parameterizable/extendable/reusable Version of this Script, on the iMacros Forum..., that also handles any Nb of Header Row(s) in the 'Modulo[n]' and could also compute dynamically the Tot_Nb_of_Rows directly from the DataSource, without even editing the Script...