Using the AutoScript pop-up window

If there is more than one property, variable, method, or statement that could be inserted, AutoScript pops up an alphabetical list of possible completions or insertions.

① An icon next to each item indicates its type, such as functions, events, variables, snippets, classes, and keywords in the following figure.

② The types are also displayed as selectable items at the bottom of the window, and the list can be filtered according to the selected types. The item filters can be hidden if you disable the "Show completion item filters" option in the Design > Options menu > AutoScript tab page.

③ QuickInfo of the selected item displays alongside the window, providing information of the item type, item name, parameter type, return type, and if a function is overloaded, text like "(+1 overload)" will be displayed (④).


What displays in the list

When you are in the following 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

  • For more contexts, refer to the next section.

The following items may be included in the list:

  • Arguments -- for the current function or event.

  • Local Variables -- defined in the current script.

  • Instance 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 -- defined for the current object and associated with all instances of it.

  • Global Variables -- defined for the current application.

  • 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.

Contexts triggering the list

For example, in the Open event, if you type "a", the auto-completion list pops up and contains a list of PowerScript functions, events, variables, classes, and keywords, such as the "abs" function, the "accessiblerole" variable, the "activate" event, etc.

The tooltip on the right side shows information on the current item.

If the list is long, you can filter the items by selecting the item types (e.g., function, event, variable, snippet, class, keyword etc.) at the bottom of the list window.


When AutoScript adds the parenthesis automatically, the cursor is placed based on whether the function has parameters. When the function has parameters, the cursor stays inside the parentheses, when the function has no parameters, the cursor stays behind the parentheses.

For example, when you type "cpu" and press the Tab or Enter key, it will automatically input "cpu()" and the cursor will stay behind the parentheses.

For another example, when you type "apply" and press the Tab or Enter key, it will automatically type "applytheme", and the cursor will stay inside the parentheses because the function requires parameter, and a tooltip will display the parameter type.


When entering a function name and typing the left parenthesis, the right parenthesis is automatically added.

When you type "String(", it will automatically input "String()" and show that it has three overloaded functions. If you enter the first parameter as 12345, type a comma, and then enter a single quote for the second parameter; at this point, a pair of single quotes is automatically added, and the tooltip is always displayed.


When you start typing inside the parentheses for a function, the auto-completion list pops up.


Typing the left parenthesis for the function will automatically insert the right parenthesis.

For example, when you type "cpu(", it will automatically add the right parenthesis, changing it to "cpu()".

When you type a window name or a menu name followed by a dot, the auto-completion list pops up.


When you type a parameter name followed by a dot in the function body, the auto-completion list pops up.


Case sensitivity

If you have set the PasteLowerCase PB.INI variable to 0 as described in Pasting statements, AutoScript always pastes uppercase characters. Otherwise, AutoScript always pastes lowercase characters.

The case of any characters you have already typed is preserved. For example, if you are using AutoScript to complete a function name and you want to use mixed case, you can type up to the last uppercase letter before invoking AutoScript. AutoScript completes the function name in lowercase characters and pastes an argument template.

Pasting an item into the script

To paste an item into the script, press Tab or Enter or double-click the item. Use the arrow and page up and page down keys to scroll through the list. If the item is a function, event, or statement, the template that is pasted includes descriptive comments that you replace with argument names, conditions, and so forth. The first commented argument or statement is selected so that it is easy to replace. You can jump to the next comment by selecting Edit > Go To > Next Marker.

Go to next marker

You can use Edit > Go To > Next Marker to jump to the next comment enclosed by /* and */ anywhere in the Script editor, not just in AutoScript templates. For the steps to create a shortcut for this menu item, see Customizing AutoScript.

If nothing displays

AutoScript does not pop up a list if the cursor is in a comment or string literal or if an identifier is complete. If neither of these conditions applies and nothing displays when you select Edit > Activate AutoScript, there may be no appropriate completions in the current context.