[quote="Hannes, iOpus"]The following batch file reads an input file line by line and uses the file's data in an imacros command line invocation
[code]
@echo off
for /f %%A in (input.txt) DO (
imacros.exe -macro "#Current" -loop %%A
)[/code][/quote]
So when it reads the line of data, what var is it passed to? How would you use the data in imacros? Specifically, I want to read a file that is a list of URLs and then I want to pass that to URL GOTO=!VAR1 or whatever I need to do. Also, would I run that batch file itself or would imacros run that piece of code? I'm still learning. Thanks for your help.
Batch file: read data from input file
Re: Batch file: read data from input file
We do not recommend performing the loop on the command line. For complex loops, use the Scripting Interface . For simple ones, i.e. repeating the full macro several times, use the "Play (loop)" button.rbantau wrote: So when it reads the line of data, what var is it passed to? How would you use the data in imacros? Specifically, I want to read a file that is a list of URLs and then I want to pass that to URL GOTO=!VAR1 or whatever I need to do. Also, would I run that batch file itself or would imacros run that piece of code?
For entering data from a CSV file, use the DATASOURCE commands, cf. CSV input