1.6

Table Of Contents
of a Print context for email and print output, and one to select a web section.
What to use a Control Script for
Control Scripts let you change the way a template is merged, by giving access to the template
with all its contexts and sections in a script. A Control Script may, for example, omit, group and
clone sections; add a background to a Print section; or add a header to an email. A number of
the things that you can do with them is listed in the table below, with a link to a topic that
explains how to do them and that shows what the script should look like.
Control Scripts differ from template scripts in two ways:
l
Control Scripts run before all other scripts. When a template consists of several contexts,
and these contexts are combined in the output - for example, when an Email is generated
with the Print context as attachment - all scripts run once for each context, but Control
Scripts always go first.
l
Control Scripts don't touch the content - meaning, the text flow - of the sections. They
don't have a selector, like the other scripts do. A selector selects parts of the content of a
section and stores them in the results object, so that they can be modified in the script.
As Control Scripts don't have a selector, the results object can't be used there.
In a Control Script, section usually is the most important object. To get a quick overview and
lots of examples, see "section" on page800. For help on specific tasks, see the table below.
Task See topic Field/function of
section object
Change the page numbering of Print
sections
"Control Script: Page
numbering" on the facing
page
restartPageNumbering
Set the background image of a Print
section
"Control Script: Setting a
Print section's
background" on
page553
background.source,
background.url,
background.position
Split Email attachments and rename "Parts: splitting and
part
Page 547