How to set URL GOTO = javascript: output to iMacros variable

时间:2017-12-18 06:02:48

标签: imacros

I was going through the official iMacros documentation for URL GOTO = javascript.

URL GOTO=http://demo.imacros.net/Automate/TestForm1
URL GOTO=javascript:window.document.getElementById("name").value='Test');

How do I set the output from the Javascript to a iMacro variable ??

Like SET !VAR1 {Javascriptoutput}

My requirement is to print the output to a csv , so I though of setting the JS output to a iMacro variable and then print it to the csv.

Any inputs on this ?

1 个答案:

答案 0 :(得分:0)

var master1= "CODE:";
master1 += "VERSION BUILD=8820413 RECORDER=FX" + "\n";
master1 += "TAB T=1" + "\n";
master1 += "SET !ERRORIGNORE YES" + "\n";
master1 += "ADD !EXTRACT {{someValue}}" + "\n";     //name
master1 += "SAVEAS TYPE=EXTRACT FOLDER=* FILE=a.csv" + "\n";

//from the imacro code after extracting your text
        var someValue= iimGetLastExtract(1);
        iimSet("someValue",someValue);  //asssign the value so tat it adds to csv file

         iimPlay(master1);    //imacro code for saving