我想循环“pin_board”并在每次循环时替换“boardarray”..这是下面的代码..`
var boardarray = ['board1', 'board2', 'board3', 'board4', 'board5'];
var text = 'pin_board';
for(var i in boardarray) {
pin_board = "CODE:";
pin_board += "VERSION BUILD=8300326 RECORDER=FX" + "\n";
pin_board += "TAB T=1" + "\n";
pin_board += "TAG POS=1 TYPE=BUTTON ATTR=TXT:Pin<SP>it" + "\n";
pin_board += "WAIT SECONDS=3" + "\n";
pin_board += "TAG POS=1 TYPE=LI ATTR=TXT:" + boardarray + "\n";
pin_board += "WAIT SECONDS=3" + "\n";
pin_board += "TAG POS=R1 TYPE=BUTTON ATTR=TXT:Pin<SP>it" + "\n";
pin_board += "WAIT SECONDS=5" + "\n";
}
iimPlay(pin_board);
感谢@karaxuna 的回复。我修改了我的脚本并在 imacros 上尝试了它。不幸的是,它只循环一次,而不是从 board1 开始,它以 baord5 开始并结束。所以它只运行一次。我不知道我是否错过了什么。
这是编辑后的代码..
var boardarray = ['board1', 'board2', 'board3', 'board4', 'board5'];
var text = 'pin_board';
for(var i = 0; i < boardarray.length; i++)
{
pin_board = "CODE:";
pin_board += "VERSION BUILD=8300326 RECORDER=FX" + "\n";
pin_board += "TAB T=1" + "\n";
pin_board += "TAG POS=1 TYPE=BUTTON ATTR=TXT:Pin<SP>it" + "\n";
pin_board += "WAIT SECONDS=3" + "\n";
pin_board += "TAG POS=1 TYPE=LI ATTR=TXT:" + boardarray[i] + "\n";
pin_board += "WAIT SECONDS=3" + "\n";
pin_board += "TAG POS=R1 TYPE=BUTTON ATTR=TXT:Pin<SP>it" + "\n";
pin_board += "WAIT SECONDS=5" + "\n";
}
iimPlay(pin_board);
谢谢,