Procedure: Creating scripts

To create and attach scripts, open the dictionary the scripts will be part of, and follow these steps.

  1. Decide the function of the script.

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.

  1. Outline the steps the script must perform.
  1. Decide where the script should be attached and when it should be run.

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.

  1. Convert the outline to sanScript.

Convert each step you outlined for the task to sanScript.

  1. Attach the script.

Use the information in Attaching Scripts to attach the script to the appropriate location.

  1. Test the script.

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.


Documentation Feedback