Editing Scripts

 
 
 

To create and edit a script, use the editing pane as you would any other text editor. You can cut, copy, paste, move, and type text. Use the history pane as a source for copying text or as a reference for command names and syntax.

Working in the Script Editor

One important thing to remember when editing scripts is to keep the mouse pointer over the script editor window. Otherwise, your keystrokes are interpreted as commands in the viewports or another Softimage window.

Commands in the Script Editor

As you work in the script editor, you can use the commands and options in the Edit and View menus on the command bar as well as in the pop-up (contextual) menu that appears when you right-click in either the history or editing panes:

   

Contextual menus in the history and editing panes

A

Contextual menu in the history pane

B

Contextual menu in the editing pane. There is a lot of functionality available from the editing contextual menu that is not available from either the command-bar menus or the keyboard shortcuts. For more information about these features, see Making Coding Easier.

You can also use standard mouse and keyboard commands:

To do this...

Do this

Select the entire contents of the editing pane.

Ctrl+a, or choose SelectAll from the context menu (right-click)

Select a word in the history or editing pane.

Double-click on the word.

Select a line in the history or editing pane.

Triple-click on the line.

Move selected text.

Drag to new location.

Copy selected text.

Ctrl+drag to new location.

Cut selected text to the clipboard.

Ctrl+x, or Shift+Delete

Copy selected text to the clipboard.

Ctrl+c, or Ctrl+Insert

Paste text from the clipboard.

Ctrl+v, or Shift+Insert

Undo the last edit.

Ctrl+z, or Alt+Backspace

Redo the last undone edit.

Ctrl+y, or Alt+Shift+Backspace

Go to the next/previous word.

Ctrl+right/left arrow

Go to the beginning of the script.

Ctrl+Home

Go to the end of the script.

Ctrl+End

Extend the selection.

Shift+arrow keys, Ctrl+Shift+arrow keys

Select from the cursor to the beginning of the line.

Shift+Home

Select from the cursor to the end of the line.

Shift+End

Select from the cursor to the beginning of the script.

Ctrl+Shift+Home

Select from the cursor to the end of the script.

Ctrl+Shift+End

Toggle overtype mode on or off.

Insert

Increase indenting on the selected block.

Tab

Decrease indenting on the selected block.

Shift+Tab

Note

If the text you type overwrites existing text, it's probably because you have accidentally pressed the Insert key. Press the Insert key again to turn overtype mode off.

Finding and Replacing Text

You can find and replace text in the editing pane:

  • To open the Find in Editing Pane dialog box, choose EditFind or press Ctrl+f.

  • To open the Replace dialog box, choose EditReplace or press Ctrl+h.

Tip

You can customize a couple of aspects of looking for text in the script editor with special preferences. For more information, see Find and Replace Features.

Clearing the Editing Pane

To clear all text from the editing pane, choose EditClear Script Editor.

Important

Using Clear Script Editor does not start a new script file. If a saved script file was open and you clear the editing pane, you will replace the file on disk if you save it instead of choosing FileSave As.

To start a new script, click the New button or choose FileNew.

Using Bookmarks

You can set bookmarks while you are working in the script editor. Bookmarks are like placeholders that allow you to jump from bookmark to bookmark until you find the right spot. For example, you may want to jump between a call to a function and the function definition itself.

You can set, remove, and navigate between bookmarks using these commands:

To do this...

Do this

Set/remove a bookmark

Ctrl+F2 toggles the bookmark on and off for line where your cursor is

Jump to the next bookmark

F2

Jump to the previous bookmark

Shift+F2

Remove all bookmarks in the file

Ctrl+Shift+F2

Tip

By default bookmarks are indicated with light blue highlighted text in the editing pane of the script editor. However, you can change this to indicate bookmarks by a light blue square in the margin instead using the Selection Margin scripting preference.

Bookmarked line (default indicator)

Bookmarked line (custom indicator)