2022.2

Table Of Contents
8. Optionally,youcanclickOptionstospecifywhereandhowthescriptinsertsitsresults:
l
AsHTML.HTMLelementsintheresultsareprocessedanddisplayedasHTMLelements.
Forinstance,<b>this is bold</b>willbedisplayedasthis is bold.Thisisthe
defaultsetting.
l
Astext.Thisinsertstheresultsas-is,meaningHTMLtagsandelementsaredisplayedas
textintheoutput.Inthisscenario,"<br>"showsupinthetextanddoesnotinsertaline
break.Thisisthepreferredsettingifthescriptproducesplaintext.Itwillbeslightlyfaster
thanHTMLsinceitavoidsprocessingwithanHTMLparser.
l
AsthevalueofanattributeofanHTMLelement.Theselectorofthescriptshouldbean
HTMLelement.WhichattributesareavailabledependsontheselectedHTMLelement.If
thescript'sselectorisanimage(<img>element)forexample,andtheattributeissrc,the
scriptwillmodifytheimage'ssource.Thescript'sresultsshouldbeavalidvalueforthe
chosenattribute.
Note: Whenchecked,theoptionConvert fields to JSON stringwritestheresults
fromthescriptintoanattributeortextasaJSONstring.Thisisusefulforwebcon-
textswhereafront-endscriptcanreadthisvalueeasily.
9. ClosetheTextScriptWizardandtypetheplaceholderfortheresultsofthescriptinthecontentof
yourtemplate,ormakesurethatthereisatleastoneelementthatmatchestheselectorofthe
script.
10. HoveroverthenameofthescriptintheScriptspane.Intheworkspaceyouwillseewhichparts
ofthetemplateareaffectedbythescript.Ifthescriptproducesanerror,theerrormessagewill
bedisplayedinahintontheScriptspane.
Tip: Whenoneoftheincludeddatafieldsisempty,therespectiveline,includingtheprefix
andsuffix,isskipped.Theresultofthescriptwillbeshorter,causingtherestofthecontent
tomoveupordown.If,inaPrintcontext,youdon'twanttheresultofthescripttobepartof
thetextflow(forexample,whenaletterisgoingtobesentinanenvelopewithawindow),
puttheplaceholderforthescriptinapositionedbox(see"Boxes"onpage226and"Howto
positionelements"onpage275).
Tip:
l
AnexampleofhowtocreateanaddressblockusingtheTextScriptWizardisdescribedin
ahow-to.
SeeHowtocreateanAddressBlock.
Page 316