To create and attach scripts, open the dictionary the scripts will be part of, and follow these steps.
Scripts perform tasks such as storing information in and retrieving information from tables, displaying and modifying data, and performing numeric calculations. With this in mind, determine the task your script will perform.
Determine when you want your script to run and decide what part of the application the user will be using when the script is run. Does some specific action such as clicking a button, closing a window, or moving the focus out of a field cause the script to run? These answers will tell you whether you should attach your script to a form, window or field, and whether the script should be a pre, change or post script.
Convert each step you outlined for the task to sanScript.
Use the information in Attaching Scripts to attach the script to the appropriate location.
Once you’ve written and compiled the script without errors, choose Test Mode from the Debug menu. Test the application where the script will run to see the results.