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!
@foxdrive - here is the code that I mentioned in the comments @ 9pm or so ....
`@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)...
set "tempfile=C:\Users\Public\Documents\iMacros\Macros\flag.txt"
type nul>"%tempfile%"
"C:\Program Files (x86)\Mozilla Firefox\firefox.exe" "imacros://run/?m="mymacro1.iim"
:loop1
if exist "%tempfile%" ping -n 10 localhost >nul & goto :loop1
type nul>"%tempfile%"
"C:\Program Files (x86)\Mozilla Firefox\firefox.exe" "imacros://run/?m="mymacro2.iim"
:loop2
if exist "%tempfile%" ping -n 10 localhost >nul & goto :loop2
type nul>"%tempfile%"
"C:\Program Files (x86)\Mozilla Firefox\firefox.exe" "imacros://run/?m="mymacro3.iim"
:loop3
if exist "%tempfile%" ping -n 10 localhost >nul & goto :loop3
rem Macro Execution completed
ECHO FINISHED!`
Now that the macros delete this temp file when they finish, this should work:
@echo off
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
set "tempfile=C:\Users\Public\Documents\iMacros\Macros\flag.txt"
echo macro 1 running
type nul>"%tempfile%"
start "" /w /b "C:\Program Files (x86)\Mozilla Firefox\firefox.exe" imacros://run/?m="mymacro1.iim"
:loop1
if exist "%tempfile%" ping -n 10 localhost >nul & goto :loop1
echo macro 2 running
type nul>"%tempfile%"
start "" /w /b "C:\Program Files (x86)\Mozilla Firefox\firefox.exe" imacros://run/?m="mymacro2.iim"
:loop2
if exist "%tempfile%" ping -n 10 localhost >nul & goto :loop2
echo macro 3 running
type nul>"%tempfile%"
start "" /w /b C:\Program Files (x86)\Mozilla Firefox\firefox.exe" imacros://run/?m="mymacro3.iim"
:loop3
if exist "%tempfile%" ping -n 10 localhost >nul & goto :loop3