2021.2

Table Of Contents
Post Pagination Scripts
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" on page931.
For more information see "Post Pagination Scripts" on page929.
Creating a new Standard Script
Writing a Standard 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. (See
"Managing scripts" on page884.)
3. Choose which kind of selector you want to use. Running a Standard 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 (all at the same time, or one by one - see
"Setting the scope of a script" on page883), 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.
Page 879