2022.2

Table Of Contents
PostPaginationScripts
PostPaginationScriptsareruninaPrintcontextafterthecontenthasbeenpaginated.Becausethey
cansearchthroughtheoutputofallPrintsections,andmodifyPrintsections(oneatatime),theymay
beusedtocreateaTableOfContents(TOC),asexplainedinthetopic:"CreatingaTableOfContents"
onpage411.
Formoreinformationsee"PostPaginationScripts"onpage410.
Creating a new Standard Script
WritingaStandardScriptstartswiththisprocedure.
1. OntheScriptspaneatthebottomleft,clickNew.Anewscriptappearsinthelist.Double-click
onittoopenit.
2. Changethenameofthescript,sothatitreflectswhatthescriptdoes.
Note: Scriptscanonlyhavethesamenamewhentheyarenotinthesamefolder.(See
"Managingscripts"onpage374.)
3. Choosewhichkindofselectoryouwanttouse.RunningaStandardScriptstartswithsearching
thetemplateforpiecesofcontentthatmatchthescript'sselector.Thecollectedpiecesofcontent
arepassedontothescript(allatthesametime,oronebyone-see"Settingthescopeofa
script"onpage373),sothatthescriptcanmodifythem.
Theselectorcanbe:
l
Text,forexample:@lastname@,or{sender}.Thetextdoesn'thavetohaveanyspecial
characters,butspecialcharactersdomakeiteasiertorecognizethetextforyourself.In
theScriptWizard,clickTextandtypethetexttofind.
l
Aselector(HTML/CSS):
n
HTMLelementsofacertaintype,suchasaparagraph:<p>.IntheScriptWizard,
clickSelectorandtypetheHTMLtagintheSelectorfieldwithouttheanglebrackets:
p.
n
HTMLelementswithaspecificCSSclass(eg.green).IntheScriptWizard,click
SelectorandtypetheclassnameintheSelectorfield,precededbyadot:.green.
n
AnHTMLelementwithaspecificID(eg.intro).IntheScriptWizard,clickSelector
andtypetheIDintheSelectorfield,precededby#:#intro.
InanHTMLfile,eachIDshouldbeunique.ThismeansthataparticularIDcanbe
usedonlyonceineachsection.
Page 370