imacro increase attr=id by one digit after every l

2019-07-16 10:31发布

问题:

imacro - I need to increase ATTR=ID: by one after each loop

TAG POS=1 TYPE=SPAN ATTR=ID:ygtvlabelel92

The ID: ygtvlabelel92 must be ygtvlabelel93 after loop and ygtvlabelel94 ....etc

回答1:

set !var1 1
add !var1 {{!loop}}
TAG POS=1 TYPE=SPAN ATTR=ID:ygtvlabelel9{{!var1}}


回答2:

//this is the JavaScript code. You have to place this code inside .js file or it will not work
var macro;

macro ="CODE:";
macro +="TAG POS=1 TYPE=SPAN ATTR=ID:ygtvlabelel{{counter}}"+"\n";

//set the counter
var counter=92;

for(var i=0;i<=10;i++)
{
iimSet("counter",counter)
iimPlay(macro)


//increase counter
counter++;
}//end of i loop