How to Stop iMacros JavaScript script?

时光总嘲笑我的痴心妄想 提交于 2019-12-22 14:59:22

问题


Each time I use loops inside iMacros script the script will not stop when I press Stop button. It just skips to another loop counter and continues.

So if I have one macro inside two loops like bellow:

while(counter < 10)
{    
    for(var i=0; i<10; i++)
    {
        iimPlay(macro)
    }    
}

I would have to press Stop couple of times until some error doesn't pop out or the counters don't stop. So how to avoid this and when I press Stop button once the script stops?


回答1:


add this:

main:{
while(counter<10)
{
for(var i=0;i<10;i++)
{
var ret=iimPlay(macro);
if (ret == -101){break main;} // abort script if user presses Stop button
}
}
}


来源:https://stackoverflow.com/questions/15772406/how-to-stop-imacros-javascript-script

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!