Go to: Synopsis. Return value. Flags. MEL examples.

Synopsis

nameCommand [-annotation string] [-command script] [-data1 string] [-data2 string] [-data3 string] [-default boolean] [-sourceType string] [string]

nameCommand is undoable, NOT queryable, and NOT editable.

This command creates a nameCommand object. Each nameCommand object can be connected to a hotkey. Thereafter, the nameCommand's command string will be executed whenever the hotkey is pressed (or released, as specified by the user).

Return value

stringThe name of the nameCommand object created

Flags

annotation, command, data1, data2, data3, default, sourceType
Long name (short name) Argument types Properties
-annotation(-ann) string create
A description of the command.
-command(-c) script create
The command that is executed when the nameCommand is invoked.
-data1(-da1) string create
-data2(-da2) string create
-data3(-da3) string create
These are optional, user-defined data strings that are attached to the nameCommand object. They can be edited or queried using the assignCommand command.
-default(-d) boolean create
Indicate that this name command is a default command. Default name commands will not be saved to preferences.
-sourceType(-stp) string create
Sets the language type for the command script. Can only be used in conjunction with the -command flag. Valid values are "mel" (enabled by default), and "python".

Flag can appear in Create mode of command Flag can appear in Edit mode of command
Flag can appear in Query mode of command Flag can be used more than once in a command.

MEL examples

// Create a nameCommand object.
//
nameCommand -ann "The Circle Tool" -c "setToolTo circleContext" circleToolNameCommand;

// Now map the nameCommand to a hotkey.
//
hotkey -keyShortcut "F5" -altModifier -name "circleToolNameCommand";