2021.2

Table Of Contents
Managing scripts
Changing the order of execution
When a record set is merged with a template to generate output, all scripts are executed once
for every record in the record set, in the order in which they appear in the Scripts pane at the
bottom left.
The order in which scripts are executed is particularly important when one script produces
content that contains a selector for another script. If the other script has already been executed,
it will not run again automatically. So, scripts that produce content that contains one or more
selectors for other scripts, need to come first.
To change the order in which scripts are executed:
l Click a script or a folder in the Scripts pane at the bottom. Drag it up or down and drop it.
Note
Control scripts are always executed first, regardless of where they are in the Scripts pane.
They can not be excluded from execution for a specific context or section, using the
execution scope of a folder; see "Execution scope" on the next page. What you can do is
disable the script or the containing folder; see "Enable/disable scripts" on page886.
Script folders
Scripts can be organized in folders. Why would you do that? For three reasons:
l Folders have an execution scope. You can specify for which contexts and sections the
scripts in a folder have to run.
l Folders provide a better overview than a long unorganized list of scripts.
l Folders make it easier to change the order of execution for a bunch of scripts (see:
"Changing the order of execution" above to learn why the order of execution is important).
Dragging a folder up or down will cause all the scripts in that folder to be executed earlier
or later, respectively.
To make a new folder on the Scripts pane:
Page 884