How to batch script on linux?

Discussions and Tech Support specific to the iMacros Firefox add-on.
Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the search box (at the top of each forum page) to see if a similar problem or question has already been addressed.
3. Try searching the iMacros Wiki - it contains the complete iMacros reference as well as plenty of samples and tutorials.
4. We can respond much faster to your posts if you include the following information: CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST
Post Reply
Ruriko
Posts: 126
Joined: Sat Feb 24, 2007 5:07 am

How to batch script on linux?

Post by Ruriko » Sun Aug 24, 2014 8:17 am

To save time from opening 50 macros manually I made a bash script for ubuntu but for some reason it won't open the 2nd macro unless the first macro is closed.

Code: Select all

#!/bin/bash
xhost localhost
firefox -no-remote -P "strangermeetup" 'imacros://run/?m=strangermeetup.iim'
sleep 5
firefox -no-remote -P "strangermeetup2" 'imacros://run/?m=strangermeetup2.iim'
Anyone know why it won't open the macro one after another?
chivracq
Posts: 9312
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: How to batch script on linux?

Post by chivracq » Sun Aug 24, 2014 2:22 pm

Ruriko wrote:To save time from opening 50 macros manually I made a bash script for ubuntu but for some reason it won't open the 2nd macro unless the first macro is closed.

Code: Select all

#!/bin/bash
xhost localhost
firefox -no-remote -P "strangermeetup" 'imacros://run/?m=strangermeetup.iim'
sleep 5
firefox -no-remote -P "strangermeetup2" 'imacros://run/?m=strangermeetup2.iim'
Anyone know why it won't open the macro one after another?
CIM...! :mrgreen:

I don't know much about Linux, but is there any equivalent to 'Start' on Linux... (to force a new Instance of a Program)?
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
jbooth
Posts: 1
Joined: Sun Aug 24, 2014 3:44 pm

Re: How to batch script on linux?

Post by jbooth » Sun Aug 24, 2014 3:47 pm

Try adding ampersand at the end of the line of the firefox command, this tells linux to run it in the background instead of waiting for it to finish.

Thanks
Joe

Code: Select all

#!/bin/bash
xhost localhost
firefox -no-remote -P "strangermeetup" 'imacros://run/?m=strangermeetup.iim' &
sleep 5
firefox -no-remote -P "strangermeetup2" 'imacros://run/?m=strangermeetup2.iim' &
Ruriko
Posts: 126
Joined: Sat Feb 24, 2007 5:07 am

Re: How to batch script on linux?

Post by Ruriko » Mon Aug 25, 2014 6:50 am

jbooth wrote:Try adding ampersand at the end of the line of the firefox command, this tells linux to run it in the background instead of waiting for it to finish.

Thanks
Joe

Code: Select all

#!/bin/bash
xhost localhost
firefox -no-remote -P "strangermeetup" 'imacros://run/?m=strangermeetup.iim' &
sleep 5
firefox -no-remote -P "strangermeetup2" 'imacros://run/?m=strangermeetup2.iim' &
Doesn't work it just runs the first macro and closes after a few seconds without finishing the macro and it doesn't start the 2nd macro right after the 1st macro
Post Reply