1

我刚开始使用 imacro,但我不知道如何设置无限循环。

我的代码是这样的:

set !loop 3
VERSION BUILD=8530828 RECORDER=FX
TAB T=1
REFRESH
TAG POS=3 TYPE=A ATTR=TXT:Like
TAB T=2
WAIT SECONDS=3
TAG POS=1 TYPE=LABEL ATTR=ID:timelineHeadlineLikeButton
WAIT SECONDS=2
TAB CLOSE
TAB T=1
WAIT SECONDS=5

set !loop 3
VERSION BUILD=8530828 RECORDER=FX
TAB T=1
REFRESH
TAG POS=3 TYPE=A ATTR=TXT:Like
TAB T=2
WAIT SECONDS=3
TAG POS=1 TYPE=LABEL ATTR=ID:timelineHeadlineLikeButton
WAIT SECONDS=2
TAB CLOSE
TAB T=1
WAIT SECONDS=5
4

4 回答 4

1

使用 Javascript 循环:

var loop;
function play(loop) {
        for (i=0;i<loop,i++;) {
            iimPlay("macro.iim"); //Play Your Macro
}
}
play(999); //loops macro 999 times

您也可以在宏中循环遍历数据数组:

var loop;
var dataline;
function play(dataline,loop) {
        for (i=0;i<loop,i++;) {
            iimSet("dataline",dataline);  //set dataline (optional)
            iimPlay("macro.iim"); //Play Your Macro
}
}
play(3,999); //starts on datasource line 3 loops 999 times

然后在你的 .iim 文件中

SET !DATASOURCE Address.csv //your csv datasource file
SET !DATASOURCE_LINE {{dataline}}  //start on that line
TAG POS=1 TYPE=INPUT:TEXT CONTENT={{!COL1}}  //1st line of your spreadsheet

享受!

于 2014-09-19T02:02:56.377 回答
1
SET !VAR1 3
SET !VAR2 {{!LOOP}}
ADD !VAR1 -{{!VAR2}}
TAB T={{!VAR1}}

(3 表示 2,因为循环不能设置 0)或:

SET !VAR1 2
SET !VAR1 {{!LOOP}}
ADD !VAR1 {{!LOOP}}
ADD !VAR1 -1
TAB T={{!VAR1}}
于 2013-12-09T20:48:48.010 回答
-1

Here is an infinite loop that alerts and breaks on error and waits 10 seconds between each loop:

function play() {
    for (i=1;i>0,i++;) {
        iimPlay("macro.iim"); //Play Your Macro
        if (iimGetErrorText()!="OK") {  //if there is an error
            alert(iimGetErrorText()); //alert the error
            break;  //break loop on error
        }
        iimPlayCode("WAIT SECONDS=10"); //Wait 10 Seconds between each loop
    }
}
play();
于 2014-09-19T14:20:34.033 回答
-1

只需使用播放(循环)按钮运行它,在最大框中说明非常大的数字

TAB T=1
REFRESH
TAG POS=3 TYPE=A ATTR=TXT:Like
TAB T=2
WAIT SECONDS=3
TAG POS=1 TYPE=LABEL ATTR=ID:timelineHeadlineLikeButton
WAIT SECONDS=2
TAB CLOSE
TAB T=1
WAIT SECONDS=5
于 2013-11-12T13:36:40.067 回答