2019.1

Table Of Contents
Note
To remove a Media or Master Page via script, give it the value undefined, or null, or an
empty string (""); see the examples below.
Examples
This script retrieves a Print section and modifies a number of settings for all of its sheets.
let section = merge.template.contexts.PRINT.sections["Section 1"];
section.sheetConfig.positions.all.allowContent = AllowContent.ALL_
SIDES;
section.sheetConfig.positions.all.media = "MyMedia";
section.sheetConfig.positions.all.masterFront = "Master page 1";
section.sheetConfig.positions.all.masterBack = undefined; // or
null, or an empty string
The following script ensures that empty backsides of single sheets are omitted.
let section = merge.template.contexts.PRINT.sections["Section 1"];
section.sheetConfig.positions.single.omitMasterOnEmptyBackside =
true;
template
The template object represents the template with all its contexts and sections. It is used
frequently in Control Scripts (see "Control Scripts" on page828 and "Control Script API" on
page1280).
It is retrieved via the merge object: merge.template (see "merge" on page1286).
Which contexts are available in the template can be queried using merge.template.contexts.
To get access to a specific context, you have to specify the ContextType (see "ContextType" on
page1308).
Field Type Description
contexts Array Array of contexts (see "context" on page1312)
available in the template. The contexts contain
the sections (see "section" on page1318).
Page 1302