1.6

Table Of Contents
All scripts, except Control Scripts, must have a selector. The selector can be text, an HTML
element and/or a CSS selector. Running a script starts with looking for pieces of content in the
template that match the script's selector.
The results of this query can vary from one occurrence of a simple text (for example:
@EMAIL@) to a large collection of HTML elements. For example, when the selector is p, the
HTML tag for a paragraph, all paragraphs will be collected and passed to the script.
Tip
Hover over the name of a script in the Scripts pane to highlight parts of the template that are
affected by the script.
Next, the script can modify the selected pieces of content, using values from the record that is
merged to the template at the time the script runs. It can, for example, hide, replace or add text
or change the style of those pieces of content. This is how scripts personalize documents.
Creating a new script
Writing a script starts with this procedure:
1.
On the Scripts pane at the bottom left, click New. A new script appears in the list. Double-
click on it to open it.
2. Change the name of the script, so that it reflects what the script does.
3.
Choose which kind of selector you want to use. Running a script starts with searching the
template for pieces of content that match the script's selector. The collected pieces of
content are passed on to the script, so that the script can modify them.
The selector can be:
l
Text, for example: @lastname@, or {sender}. The text doesn't have to have any
special characters, but special characters do make them easier to recognize for
yourself. In the Script Wizard, click Text and type the text to find.
l
A selector (HTML/CSS):
n HTML elements of a certain type, such as a paragraph: <p>. In the script
Wizard, click Selector and type the HTML tag without the angle brackets: p.
Page 529