Scripts
Scripts are reusable JavaScript that can be saved separately from tasks. The Scripts page can be found in the Admin menu and can only be accessed by Admins and Managers.
Scripts support all of the usual UI operations and cannot be deleted if they are in use by a Task Group or a Job.
Writing Scripts
The script editing page uses an implementation of the open source Monaco code editor. It includes code folding, syntax checks, as well as suggestions for Repository Document methods (type "rd."). A list of these methods can be found here. For basic information on the JavaScript engine, check here. Finally, for some basic examples of scripts that have been used in the past, check here.
The editor also has a right click menu with a few options. Here's a list of them along with some extra hot keys that might be helpful.
Note: *Note*: Some functionalities may react differently depending on your browser and keyboards setup.
Note: *Note*: Clicking on the help icon in the script page will also show these hot keys.
|
Key(s) |
Description |
|---|---|
|
Esc |
Additional popups can be closed with ESC |
|
F1 |
All commands can be accessed by pressing F1 |
|
Shift + F8 |
View error message |
|
Shift + Alt + F |
Format document |
|
Ctrl + Click |
Go to references |
|
Ctrl + Shift + 0 |
View all symbols, type ':' to categorize |
|
Ctrl + Z |
Undo |
|
Ctrl + / |
Comment out selection |
|
Menu Item |
Function |
|---|---|
|
Go to Definition |
Jumps to where a symbol (e.g., variable, function, class) is defined. |
|
Go to References |
Lists all places where the symbol is used throughout the code. |
|
Go to Symbol |
Shows a list of all symbols in the current file for quick navigation. |
|
Peek > Peek Definition |
Opens an inline editor showing the definition of a symbol without leaving your place. |
|
Peek > Peek References |
Displays all references to the symbol in a scrollable inline view. |
|
Rename Symbol |
Renames a symbol across all its usages, updating them in-place. |
|
Format Document |
Reformats the entire document to match language-specific formatting rules. |
|
Command Palette |
Opens a searchable list of all available commands (also accessible via `F1`). |