2021.2

Table Of Contents
Example
This script retrieves two Print sections. Then, depending on a value in the current record, it
enables one section or the other, so that only one of the two sections appears in the output.
var printSections = merge.template.contexts.PRINT.sections;
printSections['Section EN'].enabled = false;
printSections['Section FR'].enabled = false;
if(record.fields.Language === 'FR'){
printSections['Section FR'].enabled = true;
} else {
printSections['Section EN'].enabled = true;
}
ImageResource
The ImageResource object represents an image resource in a template.
In script, an ImageResource is retrieved via the images Array which contains a list of all image
resources that are included in the current template (see "template" on page1436).
For example: var myImage = merge.template.images[0];.
Functions and fields
Field Type Description
modified Number Timestamp of the last modification of the image resource, for
example: 1566660504000.
name String The base name of the image resource, for example: "cat.jpg".
path String The path of the image resource, relative to the template, for
example: "images/cat.jpg".
Example
The following script adds an image called 'dog.jpg' to the content of the template if the image
can be found in the template's resources:
Page 1441