MicroStrategy ONE

Creating and Executing Scripts

From the Command Manager graphical interface, you can create and execute Command Manager scripts. The script editor has many of the same features as a standard text editor, with copy/paste and one-level undo functionality. Other features of the script editor include a script syntax checker, color-coded script syntax (see Color-Coding the Text in a Script), and sample script outlines (see Script Outlines).

Command Manager also includes a command line interface for use in environments that do not support the graphical interface, such as certain Linux shell environments, or terminal connections. For instructions on using the Command Manager command line interface, see Using Command Manager from the Command Line.

To Start the Command Manager Graphical Interface

In Windows: From the Windows Start menu, go to All Programs > MicroStrategy Tools > Command Manager.

In Linux: Browse to the MicroStrategy Home folder, then to the /bin subfolder. Type mstrcmdmgrw and press Enter.

For more information about using Command Manager and for script syntax, see Command Manager Help.

Color-Coding the Text in a Script

The Command Manager script editor can display color-coded text according to its function in the script or procedure.

In a Command Manager script:

  • Reserved words display as blue.
  • Words or phrases in quotation marks display as gray.
  • Numbers display as red. Dates display as red with blue slashes.
  • GUIDs display as green.
  • All other text appears in black.

In a Command Manager procedure:

  • Keywords, such as if or boolean, display as purple, and bold.
  • Functions, classes, and methods display as red.
  • Command Manager statements display as blue.
  • Comments display as green.
  • All other text appears in black.

Script Outlines

The Command Manager script outlines help you insert script statements with the correct syntax into your scripts. Outlines are preconstructed statements with optional features and user-defined parameters clearly marked.

Outlines are grouped by the type of objects that they affect. The outlines that are available to be inserted depend on whether the active Script window is connected to a project source or a Narrowcast server. Only the outlines that are relevant to the connected metadata source are available.

To Insert an Outline Into a Script

  1. Start the Command Manager graphical interface.
  2. Connect to a metadata source.
  3. From the Edit menu, select Insert Outline.
  4. Navigate the Outline tree to locate the outline you want, and select it.
  5. Click Insert to place the selected outline into the script.
  6. Click Cancel.
  7. Modify the script as needed.