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

NameTypeDescription
commandnumberThe command id. Can be a builtin command enumerated value or custom command id.
locationCommandLocationDetailed command location to examine. Possible locations are enumerated.
includeBuiltInStatebooleanIf true, takes the built-in state of the command into account.
includeScriptSpecifiedStatebooleanIf true, accounts for the script-specified state of the command.

Possible values for the command location are:

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

Return type

TypeDescription
Promise < CommandState >The command state.