Menu Bar Commands and Keyboard Shortcuts
The following menu bar commands and keyboard shortcuts are available in Listener. The edit commands listed are also available in the Listener right-click menu. The menu bar commands for Macro Recorder are described in The Macro Recorder.
If the last change made to the Listener’s content was an edit, undoes that edit. Only one level of undo is supported. If the last change was a command evaluation, removes all the text printed in Listener by that command, making it easy to remove large print-outs. Pressing Ctrl+Z a second time restores the removed text and also selects it. This feature can be used as a quick way to cut or copy a command's output.
Displays Find dialog. Performs search in the active Listener pane 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.
Displays Replace dialog. Performs search in the active Listener pane 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 is the specified text.
Selects the text in the current brackets. Bracket balancer lets you check bracket balancing in long pieces 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.
The simplest way to use the MAXScript Listener is to enter commands at the end of the existing text and press ENTER . This is called the end-of-text compilation. After each command is executed and any results are printed to the output pane, you can enter another command and press ENTER , and so on. When you write new commands at the end of the text in Listener, pressing ENTER executes the last line and inserts a new line.
When you want to use or edit existing text in Listener, you can differentiate between inserting new lines and executing the current line as follows:
Press ENTER to insert a new line at the current cursor position.
Press Number-Pad ENTER to execute the line that contains the cursor. When you re-execute an existing line, its output and any Error Messages are inserted after the current line if the output pane is active, or at the current edit cursor location in the output pane if the Macro Recorder pane is active.
If you do not have a number pad on your keyboard, SHIFT+ENTER is an alternative to the Number-Pad ENTER key.
You can select multiple text lines and press SHIFT+ENTER to execute all of the selected lines. Each command in the selection is executed in the order it appears in the selection and any output is inserted after the entire selection. You can also select a portion of text within a line and press SHIFT+ENTER to evaluate it, as long as it constitutes a valid MAXScript expression. For example, you can display the value of a sub-expression in a long equation by selecting and executing only that sub-expression within a line. The output is inserted after the current line if the output pane is active, or at the current edit cursor location in the output pane if the Macro Recorder pane is active.
MAXScript commands may be single or multiline commands, or Block Expressions. If you want to enter a block expression or a multiline command within existing text in the MAXScript Listener window, press ENTER to insert each line. Then drag-select all the lines in the command or block and press SHIFT+ENTER to execute the lines.
If you enter multiline commands or a block expression at the end of the text in the MAXScript Listener window, remember that each line is compiled when you press ENTER . The multiline command is not executed until the end of the command is entered, nor are block expressions executed until the block is closed. While you cannot edit a faulty previous line within the multiline commands or block expression that has already been compiled but not yet executed, you can edit any text within the current line before you press ENTER . You can abort the current end-of-text compilation by pressing the ESC key to start over if necessary.
You can select one or more text lines and drag them to a 3ds Max toolbar to create a Macro Script containing the selected lines. For more information, see Defining Macro Scripts.