Friday, 9 August 2013

create a batch file to open firefox, then run a macro (wait for it to finish) then run another macro

create a batch file to open firefox, then run a macro (wait for it to
finish) then run another macro

I am trying to: (1) load Firefox (2) run Iopus Imacro (.iim) - wait for
this to finish, then (3) run the next macro.
So far I have tried start /wait - call and as many other suggestions as I
could find all over the internet and this is what I have so far (which
runs flawlessly - as long as there is only one macro file (.iim) to play):
@ECHO ON
ECHO
ECHO You have 5 sec to close this Window to prevent the Macro from running...
timeout 5
ECHO Start Firefox and wait another 10 seconds...
start /B "" "C:\Program Files (x86)\Mozilla Firefox\firefox.exe"
timeout 10
ECHO Now running the macro (in a 2nd Tab)...
"C:\Program Files (x86)\Mozilla Firefox\firefox.exe"
imacros://run/?m="mymacro1.iim"
rem Macro Execution completed
ECHO FINISHED!
When I try to add more files to run, like this:
@ECHO ON
ECHO
ECHO You have 5 sec to close this Window to prevent the Macro from running...
timeout 5
ECHO Start Firefox and wait another 10 seconds...
start /B "" "C:\Program Files (x86)\Mozilla Firefox\firefox.exe"
timeout 10
ECHO Now running the macro (in a 2nd Tab)...
"C:\Program Files (x86)\Mozilla Firefox\firefox.exe"
imacros://run/?m="mymacro1.iim"
"C:\Program Files (x86)\Mozilla Firefox\firefox.exe"
imacros://run/?m="mymacro2.iim"
"C:\Program Files (x86)\Mozilla Firefox\firefox.exe"
imacros://run/?m="mymacro3.iim"
rem Macro Execution completed
ECHO FINISHED!
Firefox starts and then loads ALL of the .iim files at once, BUT NONE of
them run.
I also tried creating more than one batch file, so that one would run,
then call a second one when the 1st one finished ... didn't work!
This code launch-macros-one-by-one-from-a-batch-file
cd C:\Program Files (x86)\Mozilla Firefox\
start firefox.exe
ping -n 05 127.0.0.1>null
start /wait firefox.exe imacros://run/?m=unlimited1.iim
start /wait firefox.exe imacros://run/?m=unlimited2.iim
Started 2 firefox windows but did not run any macros!

No comments:

Post a Comment