Designer Script API

In Designer templates, every bit of information can be tailor-made, using scripts. When Connect generates 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 (in a specific order, see The script flow: when scripts run).

Most scripts can be made using one of the Script Wizards (see Personalizing content).
However, when you want to do more than what you can do with a Wizard, you may write a script yourself. If you are not familiar with writing scripts, please read Writing your own scripts first.

All scripts in the Designer have to be written in JavaScript.
If you don't know JavaScript, the many examples given in this API will help you get started.
It is worth the effort, however, to familiarize yourself with the JavaScript syntax. For a simple script all you need to know can be found on the following web pages: https://www.w3schools.com/js/js_syntax.asp and https://www.w3schools.com/js/js_if_else.asp. A complete JavaScript guide for beginners can be found on MDN Web Docs: https://developer.mozilla.org/en-US/docs/Web/JavaScript

In the editor window, press Ctrl + Space to see the available features and their descriptions.
Use the arrow keys to select a function or object and press Enter to insert it in the script.
Type a dot after the name of the function or object and press Ctrl + space again to see which features are subsequently available.
For more keyboard shortcuts, see Keyboard shortcuts.

Designer API

The Standard Script API describes the objects and functions that are available in template scripts, created inside the Scripts pane. Template scripts change the contents of sections in a template.

Note: In a Print context, the scripts in the Scripts pane run once for each section and once for each Master Page (see Master Pages).

Control Script API

Control Scripts are a special kind of Designer Scripts. They don't touch the content of the sections themselves, but they change the way a template is outputted, for example by selecting or omitting sections from the output.
For more information about Control Scripts and their use, see Control Scripts.
Features that are specific to Control Scripts are listed in the Control Script API.

Post Pagination Script API

Post Pagination Scripts are run in a Print context after the content has been paginated. Because they can search through the output of all Print sections, and modify Print sections (one at a time), they may be used to create a Table Of Contents (TOC), as explained in the topic: Creating a Table Of Contents.

For more information about Post Pagination Scripts and their use, see Post Pagination Scripts.
Features that are specific to Control Scripts are listed in the Post Pagination Script API.