v5.0
Finds a built-in or custom command by its scripting name.
Command XSIApplication.GetCommandByScriptingName( String in_strScriptingName ); |
oReturn = XSIApplication.GetCommandByScriptingName( ScriptingName ); |
Parameter | Type | Description |
---|---|---|
ScriptingName | String | The scripting name of the command you want to find. |
// JScript example that shows how to find a command by its scripting name var oCmd = Application.GetCommandByScriptingName( "GetMarking" ) Application.LogMessage( "Command Name: \"" + oCmd.Name + "\", Command Scripting Name: \"" + oCmd.ScriptingName + "\"" ) ; // Test if a command with a given scripting name exists oCmd = Application.GetCommandByScriptingName( "CommandThatDoesNotExist" ) if ( oCmd == null ) { Application.LogMessage( "Command \"CommandThatDoesNotExist\" is not installed" ) ; } //Expected output: //INFO : Command Name: "Get Marked Parameters", Command Scripting Name: "GetMarking" //INFO : Command "CommandThatDoesNotExist" is not installed |
' VBScript example that shows how to find a command by its scripting name set oCmd = Application.GetCommandByScriptingName( "GetMarking" ) Application.LogMessage( "Command Name: """ & oCmd.Name & """, Command Scripting Name: """ & oCmd.ScriptingName & """" ) ' Test if a command with a given scripting name exists set oCmd = Application.GetCommandByScriptingName( "CommandThatDoesNotExist" ) if typename( oCmd ) = "Nothing" then Application.LogMessage( "Command ""CommandThatDoesNotExist"" is not installed" ) end if 'Expected output: 'INFO : Command Name: "Get Marked Parameters", Command Scripting Name: "GetMarking" 'INFO : Command "CommandThatDoesNotExist" is not installed |