There are four ways to customize AutoScript:
AutoScript is easier to use if you create shortcuts for the menu items that you use frequently. For example, the Edit>Activate AutoScript menu item uses F8 as a shortcut key by default, but you can select a different shortcut key or key combination for this item.
To modify or create shortcut keys for using AutoScript:
Select Tools>Keyboard Shortcuts from the menu bar and expand the Edit menu in the Keyboard Shortcuts dialog box.
If you want to select a default key for activating AutoScript, scroll down and select Activate AutoScript and type a key sequence, such as Ctrl+Space.
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.
You can change what gets displayed when you activate AutoScript. You make these changes in the AutoScript page of the Options dialog box that you open from a painter’s Design>Options menu.
Figure 6-3: The AutoScript page of the Options dialog box
You can select different items to include in these different contexts:
When you have started typing a variable or method name or the beginning of a PowerScript statement
When you have typed the name of an object followed by a dot
When the cursor is at the beginning of a new line or in white space
Table 6-3 shows what is included in an AutoScript list or pasted into a Script view when you make particular selections on the AutoScript page of the Options dialog box.
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. This makes it faster and easier to paste a completion or insert code into the script.
To show all variables and methods when typing, check all the boxes except Statement Templates in the Partial Name Resolution Include group box. When you pause or select Edit>Activate AutoScript from the main menu, the list shows variables and methods that begin with the string you typed.
To find functions for an object quickly, clear all the boxes except Methods in the After A Dot Include group box. When you type an instance name followed by a dot, only function and event names for the instance display.
To see a list of arguments and local variables when the cursor is in white space, check the Arguments and Local Variables boxes in the When No Context Include group box. When you select Edit>Activate AutoScript, the list shows only arguments and local variables.
Most of the time you are likely to 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.
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.