JS script

<< Click to Display Table of Contents >>

Navigation:  Actions > Script tools >

JS script

This action allows to perform a program, which is written in JavaScript. Notice that the languages Java and JavaScript are not the same, although they are very alike. The documentation for the language can be read on the Microsoft site: http://msdn.microsoft.com/en-us/library/hbxc2t98(v=vs.84).aspx

The action editor is a specialize text editor adapted for editing a program code.

 

JSScript

 

 

Popup proposals.

When pressing the Ctrl-Space, a popup menu with some functions and objects of JavaScript shows up on the screen. One can choose a necessary point from the list and then the editor will insert a proper line/string into a text.

If you began to enter a function name and pressed the Ctrl-Space, only alternatives corresponding to the input line will be left in the popup menu.

 

Autocomplete.

This function allows to insert standard language constructions into a text automatically. For this you need to enter 2-5 key constructions (identifier of construction) and press the combination Ctrl-J. The editor inserts the whole construction instead of the key word.

The editor supports the next constructions:

Identifier

Description

Insert Statement

if

Simple "if"

if (|)

 {

 }

ife

"if .. else" statement

if (|)

 {

 }

else

 {

 }

for

Simple  "for" loop

for (i=0; i< |; i++)

 {

 }

func

Function declaration

function |()

 {

 return 0;

 }

try

"try .. catch .. finaly" block

try {

 }

catch(e) {

 }

finally {

 }

do

"do .. while" loop

do

 {

 } while (|)

while

"while" loop

while ()

 {

 }

with

"with" keyword

with ()

 {

 }

swi

"switch" statement

switch ()

 {

 case 0:

   break;

 case 1:

   break;

 default:

 }

 

Interface

 

Load from file

Load the text of a script from a file.

 

Save script as file

Save the text of a script into a file.

 

Additional options

Expand Variables in the script - If to switch on this mode, the RoboTask expands all inserts of variables in a text before running of the script.

Save Final script into variable – If it is necessary to monitor the final text of the script, switch on this checkbox and enter the variable name. This mode is need only for control and checkout. The fact of the matter is that the substitution of variable values can break down the syntax of a script text. By means of this mode it is possible to get the final script and analyze it if it is necessary.

 

The field of a log is under the editor. The messages about runtime errors of the script are output into this field. Also the text of messages LogMessage is output here.

 

Run script

Running of a script from the editor to test. If a runtime error arises, you can see a message about the error in the field of the edit log.

 

Help

Activation of a help system.

 

 

note Related Topics

Script Extensions

JS Evaluate

VB Script

VB Evaluate

RoboTaskApp object