Run script command

Chanduk

New Member
Hi everyone ... plz suggest any real time example on javascript
Means how can i run this command i was tried .. but its throw error..
I think automation anywhere support only windows script which is same as vbscript and with .js extension
 

anisjolly

Administrator
Hi Chanduk

Can you please provide some detail on what the command is and what you are trying to achieve? The more detail you provide, the better chance you have of your question being answered.

Thanks
 

Chanduk

New Member
Hi Chanduk

Can you please provide some detail on what the command is and what you are trying to achieve? The more detail you provide, the better chance you have of your question being answered.

Thanks


ya ok simply I want to do addition of two numbers in javascript. but input should be pass as parameter from AA to js file for addition.

or like this



var args = WScript.Arguments;

if (args.length > 0)
{


var val = 10;

var val1 = 10;

var total= 0;

val = args.item(0)
val1 = args.item(1)

total = val + val1;

WScript.StdOut.WriteLine(total);

}



thanks in advance
 
Last edited:

VJR

Well-Known Member
Hello Chanduk,

AA does support JavaScript too.
Please take a look at the below screenshots.

  • In the 1st screenshot, the 10 and 20 are the two parameters passed by AA. They need to be separated by space.
  • The Return Value is a variable which will return the total of 10 and 20 back to AA.
  • The code in the Notepad is the Javascript for adding two numbers. There is a + sign prefixed before val1 and val2 to convert it to a number else it takes it as a string and shows the result as 1020 (string concatenation).
  • The 2nd screenshot shows the code in the Task Editor and the resultant total of the two parameters that were passed (10 and 20 in this case).

Warm Regards,
VJ
 

Attachments

  • AA Js1.JPG
    AA Js1.JPG
    64.1 KB · Views: 225
  • AA Js2.JPG
    AA Js2.JPG
    27.8 KB · Views: 192

g444ran

New Member
this is my script :


var val1=WScript.Arguments.item(0);
var val2=Wscript.Arguments.item(1);

String.prototype.isMatch =function(s){
return this.match(s)!==null
}

var mybool=val1.isMatch(val2);
WScript.StdOut.WriteLine(mybool);
 

VJR

Well-Known Member
The script will have to be repaired to run without any errors and then used via the 'Run Script' command in AA.
 

Sai Srinivas

New Member
Hello Chanduk,

AA does support JavaScript too.
Please take a look at the below screenshots.

  • In the 1st screenshot, the 10 and 20 are the two parameters passed by AA. They need to be separated by space.
  • The Return Value is a variable which will return the total of 10 and 20 back to AA.
  • The code in the Notepad is the Javascript for adding two numbers. There is a + sign prefixed before val1 and val2 to convert it to a number else it takes it as a string and shows the result as 1020 (string concatenation).
  • The 2nd screenshot shows the code in the Task Editor and the resultant total of the two parameters that were passed (10 and 20 in this case).

Warm Regards,
VJ

You have returned single value. May i know What is the syntax to return multiple values from vbscript using Run Script command in AA?
 

ahmad saud

New Member
I am trying to run this script through AA script command. It is giving error. Can someone please help me out with it. Thanks.
 

Attachments

  • soundex.zip
    468 bytes · Views: 6
Top