I have an iMacro 'Test.iim' and I want to play or call this iMacro from a javascript that is attached into a button click event in my webpage.
Please Help with some sample code.
Asked
Active
Viewed 1.2k times
7

NetStarter
- 3,189
- 7
- 37
- 48

Vishnu Y
- 2,211
- 4
- 25
- 38
3 Answers
7
The answer is this.
iimPlay("Test.iim")
When calling a macro inside a Macros folder put "" around the macro and it will play it. Also you can add timer for that macro like this.
iimPlay("Test.iim",60)
This means the macro has maximum 60 seconds to complete.
When playing the macro which is declared as variable inside the .js file then you do it like this
var test;
test ="CODE:";
test +="SET !ERRORIGNORE YES "+"\n";
test +="URL GOTO=www.google.com "+"\n";
iimPlay(test,60)
And that is all.

edinvnode
- 3,497
- 7
- 30
- 53
1
simple example code would be:
iimPlay(Test.iim);
here you can find additional information about it: http://wiki.imacros.net/iimPlay

Bestmacros
- 1,697
- 12
- 26
-
1I tried the above code but its not working. When i debugged in IE, its showing that iimPlay is not defined. – Vishnu Y Jan 04 '13 at 04:09
-
use it with imacros firefox add-on – Bestmacros Jan 04 '13 at 10:14
-
In order to call a macro from the application, do we need the Paid Version of iMacro? – Vishnu Y Jan 14 '13 at 11:33
-
basically yes, but you can call simple iim scripts with imacros://run/?m=you-script-name.iim you'll have to make sure your firefox is open before calling the script. – Bestmacros Jan 14 '13 at 13:57
-
@Bestmacros it gives me an error as ReferenceError: iimPlay is not defined when I am trying to run it from a webpage. – NetStarter Oct 14 '15 at 07:12
0
You can also use an imacros java script converter where you copy paste your whole script, and recieve the final code as a java script.

Advena
- 1,664
- 2
- 24
- 45