Control Script API
The table below lists the objects that are the most important in Control Scripts. Click through to the object to find a description and sample scripts.
See Control Scripts for information about this kind of scripts, how to insert them and what you can do with them.
Other objects that are available to Control Scripts
The list below isn't exhaustive: most of the objects listed in the Designer API (see Standard Script API) are also available in Control Scripts. Not all of those objects can be used in Control Scripts, however. This is because Control Scripts differ from template scripts (see What Control Scripts are). For example, the query()
function can't be used in a Control Script because it requires access to the DOM which a Control Script doesn't have.
Object | Usage |
---|---|
section |
Much of the Control Script magic is performed by setting one of the fields of the |
context |
Object that contains one context and its sections. It is accessed through the template object: merge.template.contexts . To get access to one context, you have to specify the ContextType (see ContextType), for example: |
template | The template object contains all contexts and sections. It is accessed through the merge object: merge.template . |
merge | The merge object gives access to the template with all of its contexts and sections . |
channel (see Channel) | The channel for which output is generated. This is registered in the merge object: merge.channel .Note that the channel doesn't change when the output consists of different contexts. When generating email, for example, the channel is EMAIL, even when merging the Print context to attach it to the email. |
The current record in the main data set. To get the value of a field in the record, use |