Examples of Scripts as Functions

Here are some examples of Scripts which may be useful:

To write out a full name from individual data elements:

«Script(FullName,FirstName,MiddleName,LastName)»«concat(SuffixWith(&FirstName&,’ ‘),SuffixWith(&MiddleName&,' '),&LastName&)»«ScriptEnd()»

The SuffixWith() functions will ensure that the names are suffixed with spaces only if those data elements are given values. If left blank, no spaces will be added.


Use that full name in another fillpoint:

Here we will use the FullName script to gather information about the Plaintiff, and then display the full name of the Plaintiff on the interview in some Footing text.

«Footing(Plaintiff_Last,@Blue/Microsoft Sans Serif/12@            )»«Comment(this defines the style of the footing)»
«Footing(Plaintiff_Last,Enter the address details for <FullName(Plaintiff_First,Plaintiff_Middle,Plaintiff_Last)||[Plaintiff]> below)»

Giving us something that looks like this in the interview screen:



Now add the address:

A script for single line:

«SuffixWith(&Add1&,’, ‘)»«SuffixWith(&Add2&,’, ‘)»«&City&», «&State&» «&Zip


A script for multi line:

«&City&», «&State&» «&Zip


To call the address scripts:


And because they are the same data elements, they will only appear once on the interview, but will appear in different ways on the resultant document.


Use the same scripts multiple times in the template:

Because the scripts are parameterized, it means they can be used multiple times for different parties.


Here the same script (FullName) has been used but for 3 different parties; the Plaintiff, the Defendant and the Attorney.



And with just a few tweaks to the interview e.g. Tabs / Headings / Captions, the user experience can be improved.

You could even choose to do some of that in scripts as well.

«Heading(&First&,  )»«Comment(Insert a blank space on the interview)»

«AddHeadingText(Plaintiff_First,PLAINTIFF DETAILS)»
«AddHeadingText(Defendant_First,DEFENDANT DETAILS)»
«AddHeadingText(Attorney_First,ATTORNEY DETAILS)»


When coding like this, in reusable scripts, should something need to change e.g. the style of the heading, it is easy to make the change only once in the script definition. The change is then applied to all the places where the script is called.


Related articles:

The Script Feature


Table of Contents