How to invoke an iMacro from JavaScript?

2019-03-20 17:01发布

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.

3条回答
ゆ 、 Hurt°
2楼-- · 2019-03-20 17:12

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.

查看更多
做自己的国王
3楼-- · 2019-03-20 17:22

simple example code would be:

iimPlay(Test.iim);

here you can find additional information about it: http://wiki.imacros.net/iimPlay

查看更多
一夜七次
4楼-- · 2019-03-20 17:28

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.

查看更多
登录 后发表回答