Customizing AutoScript

There are four ways to customize AutoScript:

Creating shortcut keys

AutoScript is easier to use if you create shortcuts for the menu items that you use frequently. The Edit>Activate AutoScript menu item uses F8 as a shortcut key by default, but you can change it if you prefer to use a different shortcut.

StepsTo modify or create shortcut keys for using AutoScript:

  1. Select Tools>Keyboard Shortcuts from the menu bar and expand the Edit menu in the Keyboard Shortcuts dialog box.

  2. If you want to change the default key for activating AutoScript, scroll down and select Activate AutoScript and type a key sequence, such as Ctrl+Space.

  3. Expand the Go To menu, select Next Marker, and type a key sequence, such as Ctrl+M.

    After you click OK, the shortcuts display in the Edit menu.

To make the next three customizations, select Design>Options from the menu bar and select the AutoScript tab:

Shown is the Auto Script tab, which is divided into four areas. At top is a group box labeled Partial Name Resolution Include. It has all the check boxes listed in the table that follows this illustration. Next is a group box labeled After a Dot Include. It has selected check boxes for Properties, Instance Variables, and Methods. Next is a group box labeled When No Context Include, with selected check boxes for Arguments, Local Variables, Instance Variables, Properties, and Methods. At bottom are the options Activate Only After a Dot and Automatic Pop up. These two check boxes are cleared.

Specifying what displays in the list

You can select different items to include in three different contexts:

Table 7-3 shows what is included in the list or pasted when you check each box.

Table 7-3: Setting options for AutoScript

Check box

Displays

Arguments

Arguments for the current function or event.

Local Variables

Variables defined in the current script.

Instance Variables

Variables defined for and associated with an instance of the current object or, after a dot, variables associated with the object preceding the dot.

Shared Variables

Variables defined for the current object and associated with all instances of it.

Global Variables

Variables defined for the current application.

Properties

Properties for the current object or, after a dot, properties for the object preceding the dot. Includes controls on the current window.

Methods

Functions and events for the current object or, after a dot, functions and events for the object preceding the dot.

Statement Templates

PowerScript statement templates for each type of IF, FOR, CHOOSE CASE, TRY, or DO statement with comments indicating what code should be inserted. This option is off by default.

Turning options off reduces the length of the list that displays when you invoke AutoScript so that it is faster and easier to paste a completion or insert code into the script:

NoteUsing name completion shortens the list You might not need to clear boxes on the AutoScript page to reduce the length of the list if you are using name completion and F8 to invoke AutoScript. For example, suppose you have created an instance called inv_ncst_dssrv of the class n_cst_dssrv and you know the function you want to use begins with of_g. Type the following into a script and then press F8:

inv_ncst_dssrv.of_g

AutoScript displays a pop-up window showing only the functions on n_cst_dssrv that begin with of_g.

Using automatic pop-up

Most of the time you will probably use a shortcut key to invoke AutoScript, but you can also have AutoScript pop up a list or paste a selection automatically whenever you pause for several seconds while typing. To do so, check the Automatic Popup box on the AutoScript options page. Automatic pop-up does not operate when the cursor is at the beginning of a line or in white space.

This feature is most useful when you are entering new code. You can customize the options in the Partial Name Resolution Include and After A Dot Include group boxes to reduce the number of times AutoScript pops up.

When you are editing existing code, it is easier to work with automatic pop-up off. AutoScript might pop up a list or paste a template for a function when you do not want it to. Using only the shortcut key to invoke AutoScript gives you complete control.

Using AutoScript only with dot notation

If you want AutoScript to work only when you have typed an identifier followed by a dot, check the Activate Only After a Dot box on the AutoScript options page. The effect of checking this box applies whether or not you have checked Automatic Popup. You might find it most useful when you have checked Automatic Popup, because it provides another way to limit the number of times AutoScript pops up automatically.