2022.1

Table Of Contents
var author = merge.template.properties.author;
var myProperty = merge.template.customProperties.myPropertyName;
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946).
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:
const image = merge.template.images.find(image => image.name == 'dog.jpg');
if (image) {
results.after(`<img src=${image.path}>`);
}
masterpage
The masterpage object is used to set a Master Page's header and footer or to replace its entire
HTML body. It can only be accessed in Control Scripts (see "Control Scripts" on page425 and
Page 823