2022.2

Table Of Contents
Tip: DragthedatafielddirectlytotheScriptspanetocreateascriptwithaclassselector,
withoutaddingaplaceholdertothetemplate.HoldingtheAltkeywhiledraggingcreatesascript
withatextselector.
Note: Connectversionsolderthan2020.2usedtheplaceholdertextasthescript'sselector.
Lookingfortextinatextisalessoptimizedoperationandmayimpactoutputspeedsinlonger
documents.ForthatreasonplaceholdersarenowbydefaultwrappedinaSpanandtheclassof
thatSpanisusedasthescript'sselector.
Ifyouwouldlikethedrag-and-dropmethodtobehavelikeitdidinolderConnectversions,you
canchangeitsbehaviorviathePreferences(Window > Preferences > Editing),orholdthe
ALTkeywhiledraggingtochangeitsbehavioronthefly.
Formoretipstomakeatemplategenerateoutputfaster,see"Optimizingscripts"onpage820.
UsingtheTextScriptWizard
TheTextScriptWizardcaninsertoneormoredatafieldsintoyourtemplate,eachwithanoptionalpre-
fixandsuffix.ItisrecommendedtousetheTextScriptWizardforblocksofdata,suchasaddress
blocks,andwhendatafieldscanbeemptyorneedtobeformatteddifferently.
1. CreateanewtextscriptandopentheTextScriptWizard.Therearethreewaystodothis:
l
OntheScriptspaneatthebottomleft,clicktheblacktriangleontheNewbuttonandclick
New Text Script.Anewscriptappearsinthelist.Double-clickthenewscripttoopenit.
l
Selectawordinthecontent.Right-clicktheselectionandontheshortcutmenu,choose
Text Script.
l
Dragadatafieldintothetemplateasdescribedabove,andthendouble-clickthenew
script.
TheTextScriptWizardappears.
2. Changethenameofthescripttomakeclearwhatitdoes.
Note: Scriptscanonlyhavethesamenamewhentheyarenotinthesamefolder.
3. Theselectordefineswhattolookforinthetemplate.Theresultscanbereplacedbythescript.
Tip: HoveroverthenameofascriptintheScriptspanetohighlightpartsofthetemplate
thatareaffectedbythescript.
Page 729