Search code examples
batch-fileimacros

Launch macros one by one from a batch file


In Firefox, Using Imacros, I would like to launch multiple macros from a batch file but here is the problem: I want them to run one by one.
So first 'Macro 1' will run then after it completes, 'Macro 2' will run and so on till 'Macro 7'.

My BATCH CODE:

cd C:\Program Files\Mozilla Firefox
start firefox.exe 
ping -n 05 127.0.0.1>nul
start firefox.exe imacros://run/?m=NAMEofMACRO.iim

Imacros VERSION BUILD=7601105

Solution

  • Just change your macro line to use the start switch /wait

    start /wait firefox.exe imacros://run/?m=NAMEofMACRO.iim
    start /wait firefox.exe imacros://run/?m=NAMEofNextMACRO.iim
    start /wait firefox.exe imacros://run/?m=NAMEofNextMACRO.iim
    

    That will launch each one, wait for it to finish, then start the next.