2022.2

Table Of Contents
l
Restore Defaults.ThisoptionrestoresthepreferencestoDefaults.Thisappliestothecurrent
Preferencespageonly,butnototherPreferences.
l
Apply:ThisoptionappliesthesettingsmadewithinthecurrentPreferencespage,butdoesnot
closethePreferencesdialog.
------------------------------------------------------------------------------------------
Writing your own scripts
Personalizationcanbetakenalotfurtherthanjustinsertingnamesandaddresses,andhidingorshow-
ingtextorimages.Everybitofinformationinyourcommunicationscanbemadeentirelypersonal,
usingscripts.
InOLConnect,ascriptisasmallsetofinstructionstotheprogram,writteninJavaScript.
WhenOLConnectgeneratestheactualoutput–letters,webpagesoremails-,itopensarecordset
andmergesitwiththetemplate.Ittakeseachrecord,onebyone,andrunsallscriptsforit(inaspecific
order,see"Thescriptflow:whenscriptsrun"onpage824).
Anykindofpersonalizationisdoneviascripts,butyoudon'thavetowriteeveryscriptyourself.Inmany
situationsyoucanuseaScript Wizard,whichwilldothatforyou(see"Personalizingcontent"on
page708).
Forablockofvariabledata,suchasanaddress,theText Script Wizardisaperfectfit.
ParagraphscanbemadeconditionalwithaConditional Script Wizard.
Fordynamicimages,youcanusetheDynamic Image Script Wizard.
InanEmailcontext,youareprovidedwithanumberofEmail Script Wizardstosetthesender,the
recipientsandthesubjectoftheemail.
However,whenyouwanttodosomethingthatgoesbeyondwhatyoucandowithaWizard,likecre-
atingaconditionalparagraphwithaconditionthatisbasedonacombinationofdatafields,youhaveto
writethescriptyourself.
Thistopicexplainshowscriptsworkandhowyoucancreateandwriteascriptyourself.
Script types
TherearethreetypesofscriptsintheDesigner:Control Scripts,Standard ScriptsandPost Pagin-
ation Scripts.
ControlScripts
Whenoutputisgeneratedfromatemplate,ControlScriptsrunbeforeallotherscripts,whenarecordis
mergedwithacontext.Theydeterminehowdifferentsectionsofthecontextarehandled.Theycan,for
example,makethepagenumberingcontinueoverallPrintsections,splitEmailattachments,oromit
Printsectionsfromtheoutput.
SomefunctionalityisprovidedasaScriptingWizard,forexampleConditionalPrintSections.
Page 808