Event Control Scripts |
|
|
Depending on the purpose of your script, you might need it to run as infrequently as one time per print job or as often as every printed item. These are the least frequent and most frequent "events" that occur in a print job, but a variety of events happen more frequently than one time per job and less frequently than every item.
OnAutoSelectedEvent: Runs with the same frequency with which scripts are called when the Type is set to Multi-Line Script.
When you use regular multi-line scripts, the application analyzes the design of both your script and your templates according to preset rules and determines the ideal times for the script to be called. The general goal is to evaluate the configuration of your document's serialization opportunities and copies options and then to call the multi-line script often enough to supply the document with new data, but no more often than necessary. Use OnAutoSelectedEvent to write a script that is called at those "ideal" times, even if you are also using other scripts that are associated with specific events.
OnScreenUpdate: Runs any time that the string for the associated object is updated on the screen.
An OnScreenUpdate event script runs whenever an object is updated on the screen, not only at print time. Objects are updated on the screen in response to a number of events, including when a user clicks OK to return to the template. Although other uses may exist, the most important task for this event is to write scripts that give an on-screen value to a non-printing object that is being used to create a print job log file.
OnPrintStart: Runs when the document is closed.
OnPrePrompt: Runs just before the data entry form is displayed if data entry is enabled.
OnPostPrompt: Runs after a user clicks OK to close the data entry form.
OnNewRecord: Runs when a data source file is read from. An OnNewRecord event script is run each time a new record is read from your database or text file at print time. Available for input file data only.
OnSerialize: Runs when serialization might occur. For more information, refer to OnSerialize.
OnIdenticalCopies: Runs during the print job for every printed item, even if it is a copy.
|
|
OnPrintCancel: Runs when a print job is canceled.
OnPrintEnd: Runs when a print job finishes.
Each line item in the Script pane corresponds to a separate script. When you want to write a script for a given event, click that item in the Script pane.
You can now insert whatever lines of VBScript you want into the Editor pane. Remember that to assign a value to a data source, you must add a line of script that starts with "Value =" somewhere in the script. You can click as many different items in the Script pane as you want and define a script for each one.
Related Topics