1.5
Table Of Contents
- Table of Contents
- Welcome to PrintShop Mail Connect 1.5
- Setup And Configuration
- System and Hardware Considerations
- Installation and Activation
- Installation Pre-Requisites
- User accounts and security
- The Importance of User Credentials on Installing and Running PrintShop Mail C...
- Installing PrintShop Mail Connect on Machines without Internet Access
- Installation Wizard
- How to Run Connect Installer in Silent Mode
- Activating a License
- Migrating to a new computer
- Uninstalling
- The Designer
- Generating output
- Print output
- Email output
- Optimizing a template
- Generating Print output
- Saving Printing options in Printing Presets.
- Connect Printing options that cannot be changed from within the Printer Wizard.
- Print Using Standard Print Output Settings
- Print Using Advanced Printer Wizard
- Adding print output models to the Print Wizard
- Splitting printing into more than one file
- Variables available in the Output
- Generating Tags for Image Output
- Generating Email output
- Print Manager
- Release Notes
- Copyright Information
- Legal Notices and Acknowledgments
However, when you want to do something that goes beyond what you can do with a Wizard,
like creating a conditional paragraph with a condition that is based on a combination of data
fields, you have to write the script yourself.
This topic explains how scripts work and how you can create and write a script.
How scripts work
A script is a small set of instructions to the program, written in JavaScript.
When Connect generates the actual output – letters, web pages or emails -, it opens a record
set and merges it with the template. It takes each record, one by one, and runs all scripts for it
(Control Scripts first).
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.
Page 219










