JavaScript package

The JavaScript package contains actions to run a JavaScript from a bot. These actions can run JavaScript on Windows, Linux, and UNIX based devices.

Before you start

  1. Open a JavaScript file, or specify the script you want to run using the Open action. You must associate the details of the file or script you want to run with a session name. Use this same session name for other JavaScript actions.
  2. Use the Run JavaScript action to run a function within a script or an entire script. You must use the same JavaScript session name established in the Open action.
  3. Close the JavaScript session after running the script.

    To review the bot launcher logs, navigate to C:\ProgramData\AutomationAnywhere\BotRunner\Logs\<current month>\Bot_Launcher-<today's date>.log.zip. Each zipped folder contains a file with data on the code execution, which is useful for debugging.

Note: Review the following known JavaScript exceptions (other exceptions might exist based on individual scenarios):
  • All JavaScript run with JavaScript actions on the terminal.
  • We do not support any JavaScript that requires a browser to run.

Actions in the JavaScript package

The JavaScript package includes the following actions:
Note: If you built a bot using actions from the JavaScript package from Build 5322 or earlier, the actions will be missing when you open the bot with the default package version. You must reinsert the actions and repopulate the fields.
Action Description
Close See Close action in JavaScript.
Open See Open action in JavaScript.
Run JavaScript See Run JavaScript action.