MAXScript Editor Commands

The following menu bar commands and keyboard shortcuts are available in the MAXScript Editor. The edit commands listed below are also available in the MAXScript Editor right-click menu.

File > New, CTRL+N

Opens a new MAXScript Editor window for writing a new script.

File > Open, CTRL+O

Opens a common File Open dialog for choosing an existing script. A new MAXScript Editor window then displays the selected script.

File > Close, CTRL+W

Saves the contents of the MAXScript Editor to the current file name, and then closes the Editor window. If there is not a current file name (that is, the MAXScript Editor window was opened with File > New), a common File Save dialog is opened.

File > Save, CTRL+S

Saves the contents of the MAXScript Editor to the current file name. If there is not a current file name (that is, the MAXScript Editor window was opened with File > New), a common File Save dialog is opened.

File > Save As

Opens a common File Save dialog for choosing a new file name used to store the existing script.

File > Evaluate All, CTRL+E

Evaluates the entire contents of the MAXScript Editor. This is similar to selecting all text, and then pressing SHIFT+ENTER. It has the advantage that the window's scroll position does not change.

Edit > Undo, CTRL+Z

Undoes the last change made to the MAXScript Editor's content. Only one level of undo is supported.

Edit > Cut, CTRL+X

Copies the selected text to the cut/paste buffer and deletes the text.

Edit > Copy, CTRL+C

Copies the selected text to the cut/paste buffer.

Edit > Paste, CTRL+V

Places the text in the cut/paste buffer at the cursor. If text is selected when executing this command, the selected text is replaced with the cut/paste buffer contents.

Edit > Delete, DEL

Deletes the selected text.

Edit > Select All, CTRL+A

Selects all text in the MAXScript Editor.

Search > Find, CTRL+F

Displays Find dialog. Performs search in the MAXScript Editor for the Find What text. Search can be restricted to occurrences that are not part of a larger word, or are the exact combination of uppercase and lowercase letters as the Find What text. If matching text is found, the text is selected.

Search > Find Next, CTRL+G

Repeats the last Search > Find by finding and selecting the next occurrence of the Find What text.

Search > Replace, CTRL+H

Displays Replace dialog. Performs search in the MAXScript Editor for the Find What text, and replaces the matching text with the Replace With text. Search can be restricted to occurrences that are not part of a larger word, or are the exact combination of uppercase and lowercase letters in the specified text.

Help > Help

Displays the MAXScript Online Reference.

Help > About MAXScript

Displays About MAXScript dialog.

TAB, CTRL+I

Indents selected lines of text by one tab width.

SHIFT+TAB, SHIFT+CTRL+I

Unindents selected lines of text by one tab width.

SHIFT+ENTER

A MAXScript Editor can send code selections to Listener for evaluation. Select some text in MAXScript Editor and press SHIFT+ENTER to send the selected text to Listener. Listener compiles and evaluates it and prints out the result at the end of the current text in Listener. If you press SHIFT+ENTER with no text selected, the line containing the cursor is sent to Listener for evaluation. This behavior is similar to using SHIFT+ENTER in Listener, except that the results of the evaluations are printed in the Listener, not inserted into the MAXScript Editor text.

If you have a number pad on your keyboard, the Number-Pad ENTER key is an alternative to SHIFT+ENTER and can be used to execute commands. You may find the Number-Pad ENTER key faster and easier to use.

CTRL+Right-Click

Displays a pop-up menu of all the utility, structure, user-interface item, function, handler, plug-in, tool, Macro Script, and rcmenu definitions that exist in the current script. Select one of the items in the pop-up menu to position that definition at the top of the MAXScript Editor window. This simplifies large script navigation.

CTRL+B

Selects the text in the current bracket. Bracket balancer lets you check bracket balancing in long bits of code. The balancer works with any of the following: (), [], and {}. To use it, place the cursor anywhere in the script text and press CTRL+B. If the cursor is next to a bracket, the code bracketed by it and its matching bracket will be selected and highlighted. If the cursor is not next to a bracket, the closest bracketed code containing the cursor will be selected. If you press CTRL+B again, the next outer bracketed fragment is selected, and so on. You can keep pressing CTRL+B to move out through bracket nestings. If at any point there is a bracket mismatch, the balancer will beep and not select any text.

CTRL+D

Performs a simple syntax coloring scheme in the MAXScript Editor. Each time you press CTRL+D, the window is redrawn with comments in green, MAXScript reserved words in blue, and string literals in light red. This often helps in reading large, complex programs. New text is always colored black and you have to press CTRL+D at some point to recolor the script. Syntax coloring is a programming aid and does not effect script execution.

CTRL+R

Places the cursor at the location where it was previously placed with a mouse click or a find operation. Consecutive uses of CTRL+R cycle through the last eight cursor positions. This feature is useful if you edit at one location, move the cursor elsewhere with find or scroll operations, and then want to return to the edit location. This feature allows you to quickly review the code pieces you recently worked on.