2018.2

Table Of Contents
Writing a script
1. Create a new script (see: "Creating a new Standard Script" on page724, " Adding a
Control Script" on page752 or "Adding a Post Pagination Script" on page767), or
double-click an existing script in the Scripts pane on the bottom left.
If the script was made with a Script Wizard, you have to click the Expand button before
you can start writing code. This will change the Script Wizard into an editor window.
Warning
When you change an expanded text script and save it, it becomes impossible to
edit the script using the Script Wizard again.
2.
Write the script. Click Apply from time to time to see if the script works as expected. This
will be visible on the Preview tab in the main workspace.
Syntax rules
Every script in the Designer must follow JavaScript syntax rules. For example, each
statement should end with ; and the keywords that can be used, such as var to declare a
variable, are JavaScript keywords. There are countless tutorials available on the Internet
to familiarize yourself with the JavaScript syntax.
For a simple script all that you need to know can be found on the following web pages:
https://www.w3schools.com/js/js_syntax.asp and https://www.w3schools.com/js/js_if_
else.asp.
A few examples can be found in a How-to: Combining record based conditions.
Tip
In the editor window, press Ctrl + Space to see the available features and their
descriptions.
Use the arrow keys to select a function or object and press Enter to insert it in the
script.
Type a dot after the name of the function or object and press Ctrl + space again to
see which features are subsequently available.
For more keyboard shortcuts, see "Keyboard shortcuts" on page845.
Page 726