To apply a script to a field, such as a push button or a string field, display the layout window for the window containing the field. Use the arrow tool to select the field. Display the Properties window and click the Script tab; the script types for the field will be displayed.
In the properties list, select the type of script to apply and click the lookup button. The Script Editor window will open. After you’ve saved the script, its name will appear next to the type in the properties list.
Double-clicking the script type in the properties list will also open the Script Editor window.
The script type you choose depends on the field you’re attaching a script to and when you want the script to run.
Field pre script This script runs when the focus (the location where the user currently can enter information) moves to the field from another location in the window.
Field change script This script runs if the value of the field has changed and the focus moves out of the field. Typically, most of an application’s scripts are change scripts.
In fields that toggle, such as push buttons or visual switches, the change script runs as soon as you click the field. For instance, a push button may use the following change script to open a window:
open window Customer_Note;
In editable fields, such as string or integer fields, the change script runs when the focus moves from the field and a change is detected. (Dexterity makes a comparison to the original value of the field to determine whether the contents of the field changed.)
For tree view fields, this is called the select script. List view fields have the selection changed and the item changed scripts that run when the selection of the list field has changed.
Field post script This script runs when the focus leaves the current field, regardless of whether the value of the field has changed.
ContextMenu script This script runs when the user right-clicks on the current field. It is used for context menus.
MouseEnter script This script runs when the mouse pointer moves over the current field.
MouseExit script This script runs when the mouse pointer moves off of the current field.
Collapse script This script is available only for tree view fields. It runs when a node of the tree is collapsed.
Expand script This script is available only for tree view fields. It runs when a node of the tree is expanded.
Double click script This script is available only for tree view and list view fields. It runs when the user double-clicks a node of the tree or double-clicks an item in the list.
State click script This script is available only for tree view and list view fields. It runs when the user clicks the state image for a node of the tree or an item in the list.