2022.2

Table Of Contents
Similarly,thequery()function,whichisusedtoselectcontentfromwithinascript,isunavail-
ableinaControlScript.
AddingaControlScript
ToaddaControlScript:
1. OntheScriptspaneatthebottomleft,clicktheblacktriangleontheNewbuttonandclickCon-
trol Script.Anewscriptappearsinthelist.
2. Double-clickthenewscripttoopenit.Thescripteditorappears.
3. Changethenameofthescriptsothatitreflectswhatthescriptdoes.
Note: Scriptscanonlyhavethesamenamewhentheyarenotinthesamefolder.
4. Writethescript;seethe"ControlScriptAPI"onpage1271.Ifyouarenotfamiliarwithscripting,
alsosee"Writingyourownscripts"onpage808.
Tip: NewControlScriptsaddedtothetemplatecontaincodetocontinuethepagenum-
beringoverallprintsections,andtwoexamples:onetoselectdifferentsectionsofaPrint
contextforemailandprintoutput,andonetoselectaWebsection.
WhattouseaControlScriptfor
ControlScriptsletyouchangethewayatemplateismerged,bygivingaccesstothetemplatewithall
itscontextsandsectionsinascript.AControlScriptmay,forexample,omit,groupandclonesections;
addabackgroundtoaPrintsection;oraddaheadertoanemail.Anumberofthethingsthatyoucan
dowiththemislistedinthetablebelow,withalinktoatopicthatexplainshowtodoitandthatshows
whatthescriptshouldlooklike.
InaControlScript,sectionusuallyisthemostimportantobject.Togetaquickoverviewandlotsof
examples,see"section"onpage1305.Forhelponspecifictasks,seethetablebelow.
Task See topic Field/function of sec-
tion object
Changethepage num-
beringofPrintsections
"ControlScript:Pagenumbering"onpage841
restartPageNumbering
Setthebackground
imageofaPrintsection
"ControlScript:SettingaPrintsection'sbackground"onpage845 background.source,back-
ground.url,background.position
Split andrenamePrint
emailattachments
"Parts:splittingandrenamingemailattachments"onpage843
part
Page 839