The dispatch function is used to execute a command. Commands can be dispatched with their arguments included in the command string, with their arguments provided as a JavaScript object, or in both formats.

Dispatching commands, from various files...
// Dispatching a command with no arguments...
dispatch ("version");

// Dispatching a command with a single argument, embedded into the
// command string...
dispatch ("restore-layout default");

// Dispatching a command with the argument provided in a JavaScript object...
dispatch ("find-script",
              { scriptWrapper: e.breakpoint.scriptWrapper, 
                targetPc: e.breakpoint.pc });

// Dispatching with parameters in two places.  The object will be used 
// as the base for the parameter object.  String parameters will override
// anything on the object.
dispatch ("pref maxStringLength", { isInteractive: e.isInteractive });

The isInteractive parameter is implicitly taken by every command. If true, the command should be invoked as if the user typed in the Interactive Session view. This is usually used to decide whether or not to display an acknowledgement message to the Interactive Session, via the feedback function.

Help text for commands dispatched above...
Usage: version
Help Display version information.

Usage: restore-layout [<name>]
Help Restores the view layout named <name>. If <name> is not provided, the list of available layouts will be displayed. The special name |factory| can be used to restore a default layout.

Usage: find-script <script-wrapper> [<target-pc>]
Help: Focus the script wrapped by <script-wrapper>. If <target-pc> is provided, the view will be scrolled to display the associated line.

Usage: pref [<pref-name> [<pref-value>]]
Help: Sets the value of the preference named <pref-name> to the value of <pref-value>. If <pref-value> is not provided, the current value of <pref-name> will be displayed. If both <pref-name> and <pref-value> are omitted, all preferences will be displayed.