2018.1

Table Of Contents
Tip
Content added by a script isn't visible in Design mode, but is visible and can be inspected in
Preview mode.
Creating a new script
Writing a template 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.
Note
Scripts can only have the same name when they are not in the same folder.
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 it easier to recognize the text 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 in the Selector field without the
angle brackets: p.
n HTML elements with a specific CSS class (eg. green). In the Script Wizard,
click Selector and type the class name in the Selector field , preceded by a
dot: .green.
n An HTML element with a specific ID (eg. intro). In the Script Wizard, click
Selector and type the ID in the Selector field , preceded by #: #intro.
Page 325