Javascript call in AA

hello,

How to call javascript via Run script command?

I need to fetch the label value from site.

function GetVATResult(){
string result = "";
result= document.getElementById('caption2_b-3').innerText;
alert(result);
//return result;
}
Please suggest

Comments

  • Hi Pravin,
    IN my understanding.

    WScript.StdOut.WriteLine(val);

    This line allows AA to get the reurn value. On the Run Script dialog set the field 'Return Value (Optional) to the variable you want the reurned value to be put in.
    The bad news is this isn't working for me but I swear it was working in the past. I did some refactoring of my bot and somehow broke it.

    Mt .js version is
    function getDateParameter() {
    /*
    Returns yesterdays date in yyyy-mm-dd format as the web site requires.
    */
    var d = new Date();
    // Subtract 1 day from the date.
    d.setDate(d.getDate() + 1);

    var dateString = d.getFullYear 
    + "-" + ("0" + (d.getMonth() + 1)).slice(-2) 
    + "-" + ("0" + (d.getDate())).slice(-2);
    
    WScript.StdOut.WriteLine(dateString);
    // return dateString;
    

    }

Sign In or Register to comment.