iMacros是什么自己搜,下面的代码是定义变量第二行,然后读取Datasources目录下proxy.txt的第二行并将值传递返回给js脚本:

iimSet ("LINE",2);
Macro = "CODE:";
temp = Macro + "SET !DATASOURCE proxy.txt\n";
temp = temp + "SET !DATASOURCE_LINE {{LINE}}\n";
temp = temp + "SET !EXTRACT NULL\n";
temp = temp + "ADD !EXTRACT {{!COL1}}\n";
iimPlay(temp);
recode=parseInt(iimGetExtract());
alert(recode);

Related Posts: iMacros-JavaScript传递变量后脚本提取变量 :