Understanding the Use of Multiple Event Scripts

Single line expressions and regular multi-line scripts are executed only at those times during your print job that BarTender predetermines as the most appropriate. Depending on the structure of your document and the content of your scripts, your scripts could be executed as infrequently as once per entire print job or as often as every single record encountered in a database. There are times however, when you need more precise control over when your scripts execute.

When the Type of Visual Basic Script for a data source is set to Event Control Scripts, the Event List option showing numerous script types appears to the left of the Script edit box. For any object on a template, you can define scripts for any or all of the events in the event list.

Selecting the Events For Which to Write Scripts

Each line item in the event list corresponds to a separate script. When you want to write a script for a given event, simply click on that item in the Event List. This will cause the script associated with the previously highlighted item to no longer be displayed in the Script edit box and the script associated with the newly highlighted event to be displayed instead. (Notice that, other than one or two lines of comment at the top, all of the scripts except for the OnAutoSelectedEvent start out completely blank.) You can now insert whatever lines of Visual Basic Script you desire into the Script edit box. (Don’t forget that to assign a value to a data source, a line of script beginning with "Value =" needs to appear somewhere in the script.) You can click on as many different items in the event list as you want and define a script for each one.

The Different Script Types in the Event List