2019.2

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;
clone()
This function returns a new set containing a copy of each element in a set; see "Dynamically
adding sections (cloning)" on page895.
To duplicate an existing template element, clone it before calling append(); see "Examples" on
page1300.
Examples
This script performs an iteration over the elements in the results (the elements that match the
selector of the script).
var row = query("tbody tr", results).clone();
query("tbody", results).append(row);
Page 1376