EditCommand

Description

Opens the specified Command in the command editor.

The command editor displays useful information such as the command arguments, the name of the file where the command is implemented, and whether the command can be used in batch mode.

You can use the command editor to edit commands created with XSIApplication.CreateCommand. Built-in and self-installed commands are read-only in the editor. To edit a self-installed command, you have to open the command's source code file and edit its Init callback (see Definition Callbacks for Commands).

Scripting Syntax

oReturn = EditCommand( CommandName );

Return Value

Returns true if the command was canceled, and false otherwise.

Parameters

Parameter Type Description
CommandName String SIObject.Name of the command. The command name is not the same as the scripting name. The scripting name is the name you use to run the command in the script editor, and the command name is the name used to identify the command in the XSIApplication.Commands collection.

Examples

JScript Example

// Look up the command by its scripting name.

// Tip: it is much faster to look up a command by its name.

var scriptingNameToFind = "RenderPass";

var oCommandCollection = Application.Commands;

var commandName = "";

for ( i = 0; i < oCommandCollection.Count ; i++ )

{

	var oCurrentCommand = oCommandCollection(i);

	if (scriptingNameToFind == oCurrentCommand.ScriptingName)

	{

		commandName = oCurrentCommand.Name;

	}

}

// if the command was found, open it in the command editor

if ("" != commandName)

{

	// This displays a dialog box with information

	// about the command

	EditCommand( commandName );

}

See Also

Command Command.Update XSIApplication.CreateCommand