How to Stop iMacros JavaScript script?

2019-05-18 21:09发布

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条回答
我想做一个坏孩纸
2楼-- · 2019-05-18 22:04

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
}
}
}
查看更多
登录 后发表回答