RoboTask User's Guide
Keyword Index
Home page

IconQuick Start Guide
IconSeveral practical recommendations
IconTriggering Events
IconOther software

© 2004-2020 TaskAutomation.Software

JS script

Top  Previous  Next

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:

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





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.



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:



Insert Statement


Simple "if"

if (|)




"if .. else" statement

if (|)







Simple  "for" loop

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




Function declaration

function |()


 return 0;



"try .. catch .. finaly" block

try {


catch(e) {


finally {



"do .. while" loop



 } while (|)


"while" loop

while ()




"with" keyword

with ()




"switch" statement

switch ()


 case 0:


 case 1:







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.



Activation of a help system.



note Related Topics

Script Extensions

JS Evaluate

VB Script

VB Evaluate

RoboTaskApp object