To run a script in batch mode, you must set the environment and then start Autodesk Softimage with the script.
Before running a script in batch mode, you should first set the environment properly:
To run the program and a script in batch mode, start Autodesk Softimage with the -script switch, specifying your script file name. There are several ways to do this, depending on whether you need to specify the scripting language, specify the procedure to run, or supply values for arguments.
To run a simple VBScript file named myscript.vbs, use the following syntax at the command prompt:
xsi -script myscript.vbs
The scripting language is determined by the file name extension according to information in the registry: by default, this is .vbs for VBScript, .js for JScript, and .pys for Python. If your script file uses a different extension, you can specify the language explicitly with the -lang switch. For example, to run a script file named myscript.xxx, use one of the commands below:
xsi -script myscript.xxx -lang VBScript xsi -script myscript.xxx -lang JScript xsi -script myscript.xxx -lang Python
By default, when you run a script in batch mode, only global code is executed. If your script contains procedures, you can use the -main switch to specify which procedure to run. For example, to run a procedure named myproc in a VBScript file named myscript.vbs, use the following syntax:
xsi -script myscript.vbs -main myproc
If your procedure requires arguments, you can specify them after the -args switch. For example, if the procedure myproc in myscript.vbs requires two arguments named myargname1 and myargname2, you can run the procedure and set the argument values with the following syntax (it should all be on one line):
xsi -script myscript.vbs -main myproc -args -myargname1 myargvalue1 -myargname2 myargvalue2
Except where otherwise noted, this work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License