2018.2

Table Of Contents
Control Script API
The table below lists the objects that are the most important in Control Scripts. Click through to
the object to find a description and sample scripts.
See "Control Scripts" on page751 for information about this kind of scripts, how to insert them
and what you can do with them.
Other objects that are available to Control Scripts
The list below isn't exhaustive: most of the objects listed in the Designer API (see "Standard
Script API" on page1100) are also available in Control Scripts. Not all of those objects can be
used in Control Scripts, however. This is because Control Scripts differ from template scripts
(see "What Control Scripts are" on page751). For example, the query() function can't be used
in a Control Script because it requires access to the DOM which a Control Script doesn't have.
Object Usage
"section"
on
page1196
Much of the Control Script magic is performed by setting one of the fields of
the section object. Via the section object you can omit, select and clone
sections; add a background to a Print section; add a header to an email; etc.
A section can be retrieved via the context that it belongs to, using
merge.template.contexts.ContextType.sections["section name"]. For
example: merge.template.contexts.PRINT.sections["Section EN"].
"context"
on
page1190
Object that contains one context and its sections. It is accessed through the
template object: merge.template.contexts.
To get access to one context, you have to specify the ContextType (see
"ContextType" on page1187), for example: var printContext =
merge.template.contexts.PRINT;.
Through the merge object you can find out which context is currently being
merged: merge.context.
"template"
on
page1182
The template object contains all contexts and sections. It is accessed
through the merge object: merge.template.
"merge" on
page1167
The merge object gives access to the template with all of its contexts and
sections .
Page 1162