2020.2

Table Of Contents
Standard Script API
This page lists the global objects and functions that are available in Standard Scripts, created
inside the Scripts pane. Click through to an object or function to get a description and
examples.
Most of these objects and functions are also available in Control Scripts ("Control Scripts" on
page890) and Post Pagination Scripts ("Post Pagination Scripts" on page906).
For objects and functions restricted to Control Scripts see "Control Script API" on page1379,
and for the Post Pagination Script API see "Post Pagination Script API" on page1415.
The basics of script-writing in the Designer are explained in the following topic: "Writing your
own scripts" on page853.
Objects
Object Description
"results" on
page1420
This object - of the type: QueryResults - is used to manipulate the content
of the template. It contains the HTML element or set of HTML elements that
match the selector of the script, specified in the script editor.
This object is not available in Control Scripts, because that type of script
doesn't have a selector (see "Control Scripts" on page890).
"this" on
page1338
A Standard script or Post Pagination script that has its scope set to "Each
matched element" (see "Setting the scope of a script" on page860) will be
called in a loop over the elements that match the selector of the script - the
results (see "results" on page1420). In such a script, this is an object of
the type QueryResult. It represents the current element in the loop.
This object is not available in Control Scripts, because that type of script
doesn't have a selector (see "Control Scripts" on page890).
"record" on
page1295
The record in the main data set that is currently being merged. To get the
value of a field in the record, use record.fields['fieldname'] or
record.fields.fieldname.
"logger" on
page1289
Global object that allows you to log messages.
Page 1267