Managing Script Files

 
 
 

After you write a script, you can save the contents in the editing pane as a script file. You can also open existing script files in the script editor.

Scripts are saved as plain text files with an extension that denotes the scripting language. For more information about the supported scripting languages, see Introduction to Scripting in Softimage.

Choosing Where to Save Script Files

Although, you can save script files anywhere, it is recommended that you use a standard location. This makes it easier to track your scripts, especially when editing and updating them. The default location is the Data\Scripts folder in your user path.

You can click the Paths button in the Open Script File and Save Script File dialog to choose different locations as shown in the following figure:

  • Installation (Factory) is the location where the Softimage program files are installed. Scripts saved here are available to any user on the local machine. You must copy these scripts if you install Softimage to a new location.

  • Workgroup lets you share scripts, presets, and other data with members of your team. To set a workgroup application path, select File Preferences in the application menu bar and set the Workgroup(s) option in the Data Management preferences as shown in the following figure.

  • User is your user path. For example, C:\users\xyz\Autodesk\Softimage_<version>. You can access the scripts saved in this location whenever you log on as the same user.

  • Sample Project is a project that contains sample scenes included with Softimage. It is not recommended to save your scripts here.

  • Current Project is a project that contains the open scene. You can use this folder if your script is specific to a particular project.

  • Factory Add-ons is the Addons folder in the location where the Softimage program files are installed.

  • User Add-ons is the Addons folder in your user path.

  • Other projects in your Projects List are listed under Projects.

There is a Scripts folder in each project. This is a good location to save a script file if it is specific to a particular project or scene, or if you want to make sure that the correct version of a script is stored with a project for archiving.

Saving Script Files

You can either save the entire contents of the editing pane or just the selected text.

To save the entire contents of the editing pane to the disk as a script file, do one of the following:

  • Click the save icon on the command bar.

  • Select File Save from the command bar.

  • Press Ctrl+S.

You must make sure to provide the correct file extension based on the language of the script.

To save the entire contents of the editing pane with a new name:

  • Select File Save As from the command bar.

To save selected text as a script file:

  1. Select the text in the editing pane.

  2. Select File Save Selection from the command bar.

You must make sure that the file extension is correct for the script language when saving files.

Opening Script Files

You can open a script file from the script editor's File menu, or by dragging and dropping. You can also open a script file that is registered as a custom command directly from its command button.

Note The scripting language that is set in your user preferences automatically changes to the language of the script file when you open it.

To open a script file from the File menu:

  1. Do one of the following to display the Open dialog box:

    • Select File Open from the command bar.

    • Press Ctrl+O.

    If the current contents of the editing pane are not saved, you are prompted to save them.

  2. Select a script file and click OK.

    The contents of the script file appear in the editing pane. The name of the file is displayed in the script editor's title bar.

To open a script file by dragging and dropping:

  • Drag the script file from a browser view into the editing pane, or drag a link to the script file from net view. On Windows, you can also drag it from a folder window.

To open a script file that is registered as a custom command:

  • Right-click the command button in a custom toolbar, and choose Edit Script.

Starting New Script Files

Do one of the following:

  • Click the new icon on the command bar.

  • Select File New from the command bar.

  • Press Ctrl+N.

ImportantYou can clear the contents of the editing pane by choosing Clear Script Editor from the Edit menu. However, this action only clears the open file in the editing pane and does not create a new script file. If you select Save instead of Save As after clearing the editing pane, the open file in the disk is overwritten.

Creative Commons License Except where otherwise noted, this work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License