By default, custom commands can be:
These "capabilities" can be disabled in the Init callback:
function MyCommand_Init( ctxt ) { var oCmd; oCmd = ctxt.Source; // ... // Disable keyboard mapping for this command oCmd.SetFlag(siSupportsKeyAssignment,false); // true by default // Command cannot be used with xsibatch or xsi -script oCmd.SetFlag(siCannotBeUsedInBatch,true); // false by default // Disable logging oCmd.SetFlag(siNoLogging,true); // false by default // ... return true; }
The SetFlag or SetFlag method is used to set the "capability flags" that control the behavior of the command:
Specifies whether a keyboard shortcut can be assigned to the command in the Keyboard Mapping dialog box. Set to false if the command is a low-level helper function that you don't want to expose for general use.
Specifies whether the command can be used in scripts run from the command line using xsibatch or xsi -script. For example, a command that requires user input cannot be used in batch mode.
Specifies whether the command is logged to the command history. Disabling logging can improve performance. For example, if the custom command is called frequently by other scripts, or if the command takes a large collection of objects as an argument, disabling logging will speed up the command.
Except where otherwise noted, this work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License