Skip to main content

GetCommandState

Description

Gets the command state for builtin or custom command in specified location.

Syntax

// shellFrame points here into the IShellFrame interface
const result = await shellFrame.Commands.GetCommandState(
command,
location,
includeBuiltInState,
includeScriptSpecifiedState,
);

Parameters

NameOptionalityTypeDescription
commandRequirednumberThe command id. Can be a builtin command enumerated value or custom command id.
locationRequiredCommandLocationDetailed command location to examine. Possible locations are enumerated.
includeBuiltInStateRequiredbooleanIf true, takes the built-in state of the command into account.
includeScriptSpecifiedStateRequiredbooleanIf true, accounts for the script-specified state of the command.

Possible values for the command location are:

NameValueDescription
Undefined0Undefined value.
MainMenu1Specifies the command appearance in the main menus, such as top menu and command bars.
ContextMenu2Specifies the command appearance in the context menu.
ActivityContextMenu6Specifies the command appearance in the activity context menu.

Return type

TypeDescription
Promise < CommandState >The command state.