当他来到文件末尾时,如何让宏再次从文件中获取同一行
How to get macros take again same line's from the file, when he came to the end of file
当他到达文件末尾时,如何让宏再次从 txt 文件中获取同一行。我有一个脚本,它从文件中获取 google+ url 页,其中有 35 links,然后我有另一个网站 links 的文件,我需要 post 在墙上。每个 web-link 需要在 35 个 google+ 页面中的每个页面上 posted。目前脚本访问所有 url 的 post 首先 link 来自文件,但当他到达文件末尾时,宏停止工作。有什么建议吗?
这是我的脚本
var macros;
var loop = 1;
macros = "CODE:";
macros += "SET !DATASOURCE google_pages.txt" + "\n";
macros += "SET !DATASOURCE_LINE {{i}}" + "\n";
macros += "URL GOTO={{!COL1}}" + "\n";
macros += "TAG POS=1 TYPE=DIV ATTR=CLASS:\"kqa es\"" + "\n";
macros += "SET !DATASOURCE links.txt" + "\n";
macros += "SET !DATASOURCE_LINE {{!LOOP}}" + "\n";
macros += 'EVENTS TYPE=KEYPRESS SELECTOR="div[class=\"df b-K b-K-Xb URaP8 editable\"]" CHARS={{!COL1}}' + "\n";
macros += "TAG POS=1 TYPE=DIV ATTR=CLASS:\"d-k-l b-c b-c-Ba qy jt\"" + "\n";
loop += prompt("How many times to play macros?:", loop);
for(i = 1; i <= loop; i++) {
iimSet("i",i)
iimDisplay("Loop Plays: "+i)
iimPlay(macros)
}
据我了解这个问题,您应该查看以下片段:
var linesInTxt = 35;
var numToRepeat = 2;
var loop = numToRepeat*linesInTxt;
for (i = 1; i <= loop; i++) {
var j = (i % linesInTxt == 0) ? linesInTxt : i % linesInTxt;
iimSet("i", j);
// further code here
}
当他到达文件末尾时,如何让宏再次从 txt 文件中获取同一行。我有一个脚本,它从文件中获取 google+ url 页,其中有 35 links,然后我有另一个网站 links 的文件,我需要 post 在墙上。每个 web-link 需要在 35 个 google+ 页面中的每个页面上 posted。目前脚本访问所有 url 的 post 首先 link 来自文件,但当他到达文件末尾时,宏停止工作。有什么建议吗?
这是我的脚本
var macros;
var loop = 1;
macros = "CODE:";
macros += "SET !DATASOURCE google_pages.txt" + "\n";
macros += "SET !DATASOURCE_LINE {{i}}" + "\n";
macros += "URL GOTO={{!COL1}}" + "\n";
macros += "TAG POS=1 TYPE=DIV ATTR=CLASS:\"kqa es\"" + "\n";
macros += "SET !DATASOURCE links.txt" + "\n";
macros += "SET !DATASOURCE_LINE {{!LOOP}}" + "\n";
macros += 'EVENTS TYPE=KEYPRESS SELECTOR="div[class=\"df b-K b-K-Xb URaP8 editable\"]" CHARS={{!COL1}}' + "\n";
macros += "TAG POS=1 TYPE=DIV ATTR=CLASS:\"d-k-l b-c b-c-Ba qy jt\"" + "\n";
loop += prompt("How many times to play macros?:", loop);
for(i = 1; i <= loop; i++) {
iimSet("i",i)
iimDisplay("Loop Plays: "+i)
iimPlay(macros)
}
据我了解这个问题,您应该查看以下片段:
var linesInTxt = 35;
var numToRepeat = 2;
var loop = numToRepeat*linesInTxt;
for (i = 1; i <= loop; i++) {
var j = (i % linesInTxt == 0) ? linesInTxt : i % linesInTxt;
iimSet("i", j);
// further code here
}