2019.2

Table Of Contents
Field Type Description
on
page1395
Note! In Control Scripts, merge.section is only available
when the output channel is WEB. To make sure that it is
defined, use the following statement: if (merge.channel ==
Channel.WEB && merge.context.type == ContextType.WEB)
{ ... }.
To retrieve any section in a Control Script, use:
merge.template.contexts.ContextType.Section['Section
name']; (for example:
merge.template.contexts.PRINT.sections["Section EN"]).
In Post Pagination Scripts, only Print sections are available.
"template"
on
page1379
Template This object contains the template and all of its contexts. It can
be used to find out which contexts are available in the
template, using merge.template.contexts (see
"context" on page1387) and to manipulate the sections in
those contexts (see "section" on page1395).
resource()
The resource() function returns information about an image resource. This function is useful in
a Control Script, for example to check the number of pages or the page height and width before
setting it as a background (see "Control Script: Setting a Print section's background" on
page893).
This function can also be used to check if a file exists. It returns null if the file does not exist.
There is no need to explicitly check for null; a check to see if a resource exists can simply be
written as:
var info = resource(path);
if (!info) {
// File does not exist
}
resource(location, pageNumber)
location
Page 1360