CreateScriptCommand

Description

Creates a command that runs a script. Note: The Command object, used in conjunction with XSIApplication.CreateCommand, provides a much more powerful API for specifying custom commands.

Scripting Syntax

CreateScriptCommand( CommandName, ScriptName, FileName, [ProcName], [Description] )

Parameters

Parameter

Type

Description

CommandName

String

Name displayed in the user interface (on toolbar buttons, in the Customize menu).

ScriptName

String

Name used to run the command in scripting.

FileName

String

Path and name of the script file.

ProcName

String

Name of a scripting function or subroutine.

Default Value: Script runs from the start of the file

Description

String

Description of the command.

Return Value

Returns a unique String identifier for the command.

Examples

VBScript Example

sub Install()
   dim file, toolbar, command, path

   path = Application.InstallationPath( siUserPath )
   file = path & "\Data\Scripts\myUtils.vbs"

   'Create Toolbar
   toolbar = CreateToolbar("Utilities")

   'Create Commands
   command = CreateScriptCommand( "Simplify It" ,_
                 "makeSimple" ,_
                 file ,_
                 "MakeSimple",_
                 "Makes life easier." )

   'Add button to toolbar.
   CreateToolbarButton toolbar, command
end sub

See Also

CreateToolbar

CreateToolbarButton

CreateToolbarControl

RemoveScriptCommand

XSIApplication.AddCommand

 

 

 



SOFTIMAGE|XSI v6.01     

Return to Softimage XSI Index