如何从 JavaScript 调用 iMacro?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/14135483/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to invoke an iMacro from JavaScript?
提问by Vishnu Y
I have an iMacro 'Test.iim' and I want to play or call this iMacrofrom a javascript that is attached into a button click event in my webpage.
Please Help with some sample code.
我有一个 iMacro ' Test.iim',我想从附加到我网页中的按钮单击事件中的 javascript播放或调用这个iMacro。
请帮助一些示例代码。
回答by macroscripts
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.
这意味着宏有最多 60 秒的时间来完成。
When playing the macro which is declared as variable inside the .js file then you do it like this
当播放在 .js 文件中声明为变量的宏时,你可以这样做
var test;
test ="CODE:";
test +="SET !ERRORIGNORE YES "+"\n";
test +="URL GOTO=www.google.com "+"\n";
iimPlay(test,60)
And that is all.
这就是全部。
回答by Bestmacros
simple example code would be:
简单的示例代码是:
iimPlay(Test.iim);
here you can find additional information about it: http://wiki.imacros.net/iimPlay
在这里您可以找到有关它的其他信息:http: //wiki.imacros.net/iimPlay
回答by Tanckom
You can also use an imacros java script converterwhere you copy paste your whole script, and recieve the final code as a java script.
您还可以使用imacros java 脚本转换器,在其中复制粘贴整个脚本,并以 java 脚本的形式接收最终代码。