Nouth
Nouth

Reputation: 51

bash file run one imacros after another

I have tried searching but all I can find is batch which is windows so I assume the equivalent is bash for ubuntu
batch example
I am using ubuntu and firefox and want something that I can use from the imacros panel the same way I use .iim files, is this possible?
I do not know batch or bash, I just want to run one imacros and then run a second one after it.

and if it's possible to schedule them to run at a specific time, I'm not sure if/how it can be done using cron.

Upvotes: 0

Views: 2447

Answers (2)

max
max

Reputation: 449

you can launch a iMacros macro from terminal using:

firefox "imacros://run/?m=my_macro.iim"

If you want to create a cronjob, edit your crontab with

crontab -e

and enter for example:

* * * * * export DISPLAY=:0 && firefox "imacros://run/?m=my_macro.iim"

The trick is to use "DISPLAY=:0" before firefox (because firefox is GUI application). Note that "* * * * *" means "run it every minute" (see https://help.ubuntu.com/community/CronHowto for more info).

If you want to automatically close Firefox when your macro is done, just add "TAB CLOSE" at the end of your macro's code (it is much nicer than killing Firefox).

I hope it helps!

Upvotes: 1

David Ruhmann
David Ruhmann

Reputation: 11367

New to Bash or Batch follow these steps:

1. Bookmark SS64.com

This website has great definitions and examples for almost all of the common shell commands.

2. Familiarize yourself with the shell.

Play around on the command line so that you are comfortable with how it acts.

3. Scripts are just a listing of commands.

Whether dealing with Batch (.bat) or Bash (.sh), understand that these scripts are just a list of commands.


As for iMacros, I am not completely sure what you are asking.

Do you just want to run a couple of .iim files based upon a schedule?

This page talks about scheduling imacros cron jobs: http://wiki.imacros.net/Linux#Activate_the_cron_entry

Upvotes: 0

Related Questions