MicroStrategy ONE

Automatically completing a script command

Command Manager can automatically predict the next word in the script statement you are currently typing. This can significantly speed up the time it takes you to create a Command Manager script.

Creating a Command Manager script requires some knowledge of the Command Manager commands. The syntax guide and the sample script statements are useful references to these commands. The Auto-complete feature can help reduce your dependency on these two tools.

Auto-complete predicts what the next token in the current script statement will be, or what token you are currently typing. A token is a word, a list of words enclosed in quotation marks, or a symbol that is part of a script's syntax. A token is recognized by Command Manager as an individual syntactical unit with a specific meaning. For more information about tokens, see Command Manager syntax.

Auto-complete automatically activates after five seconds. For example, you could type UNR and wait five seconds, and Auto-complete fills in the rest of UNREGISTER. You can also activate Autocomplete manually by pressing CTRL+SPACE. For example, you could type UNR and press CTRL+SPACE to fill in the rest of UNREGISTER, or you could type GET and press CTRL+SPACE for a list of the words that can come after GET in a script.

When Auto-complete is activated, it has one of the following effects:

  • If there are several possible valid tokens, a list of the possible choices appears. Select one of the tokens from this list by highlighting it with the arrow keys and pressing ENTER. That token is inserted into the script.

    For example, if you type the word GET followed by a space and then activate Auto-complete, a list pops up containing the tokens that can follow GET, namely CHILD, PARENT, PROPERTIES, and TABLES. You can select CHILD from this list by highlighting it with the arrow keys and pressing ENTER, and it is inserted into the script.

  • If there is only one valid token, that token is inserted without bringing up a list.

    For example, if you type GET CHILD followed by a space, the only token that can come after GET CHILD is CANDIDATES. Activating Auto-complete inserts CANDIDATES into the script without bringing up a list.

  • If there are no tokens that can follow a statement, activating Auto-complete has no effect.

    For example, if you type GTE (instead of GET), there are no tokens that can make that into a syntactically correct Command Manager script statement. Activating Auto-complete in this case has no effect.

Reserved words that Auto-complete inserts into a script are inserted in upper-case. For more information about reserved words, including a list of all reserved words in Command Manager, see Reserved words.

When Auto-complete expects an identifier to be the next token in a statement, it inserts the name of the identifier type enclosed in double quotes ("). For example, if you type GET CHILD CANDIDATES FOR ATTRIBUTE and then activate Auto-complete, the token that comes after ATTRIBUTE must be the name of the attribute. Auto-complete inserts "string" into the script, so that you can replace the word string with the name of the attribute.

To automatically complete a script command

  1. Connect to a project source or Narrowcast Server, or open a connection-less window. (How?)

  2. Begin typing a statement in the editing pane of the Script window.

  3. To see all possible tokens that can come next in the statement, either wait five seconds or press CTRL+SPACE.

  4.  If only one token can come next in the statement, that token is inserted into the script.

  5. If multiple tokens can come next in the statement, a list of tokens appears. Select the token you want from the list and press ENTER. That token is inserted into the script.

To enable or disable Auto-complete

  1. From the Tools menu, select Options. The Options dialog box opens.

  2. Click the Display tab.

  3. Select or clear the Enable Auto-complete check box to enable or disable the Auto-complete feature.

  4. When you are finished making changes, click OK. The Options dialog box closes and Auto-complete is enabled or disabled.

Related Topics

Command Manager syntax

Editing a script

Executing a script

Inserting sample statements: Outlines

Inserting previously executed scripts: Script History