newScript()
method still open instances of the Legacy Editors. For documentation of the new Scripting Editor, see Scripting Editor Window.You can create an empty Legacy Scripting Editor window from within the Listener or from other running scripts by calling the newScript()
method.
The syntax for the newScript()
method is:
newScript()
Opens an empty Scripting Editor window and returns a WindowStream
value that can be used as the target for print and format operations. This is useful for directing output to a separate window for ease of inspection or editing, or later saving to a file. Output to a WindowStream
is inserted at the current cursor position in that window.
newScript()
method still creates a Legacy Editor and not a new tab in the new Editor.FOR EXAMPLE:
b=box()
debug = newScript()
-- ...
print b to:debug
-- ...
format "name is %\n" b.name t:debug
Titles that display only the current script's file name, rather than its full path name, so minimized Scripting Editor windows can be easily distinguished.
A line selection margin at the left window border. When you move the cursor into the left margin, it changes to a right-pointing arrow. A single-click selects an entire line and click-dragging selects multiple lines.
Drag-and-drop for moving and copying text to and from other Scripting Editor windows, the Listener window, or any other text editor window that supports Window’s drag-and-drop. Simply dragging the text will move it. Holding down Ctrl while dragging will copy the text.
Selected text is loaded automatically into the search text dialog field when you choose Search > Find or Search > Replace. This is useful for quickly finding other occurrences of the selected text.
Selected text is loaded automatically into the Index field of this Online Reference - highlight a keyword in the Scripting Editor and press the F1 button to open the Online Reference and search for information on the selected keyword.
Syntax Coloring - manual syntax coloring is supported. Additionally, in 3ds Max 5 and higher, automatic syntax coloring will be performed when opening files and for the current line while typing in the Editor.
Bracket Balancing - place the cursor next to a bracket and press Ctrl+B to select all the text between this bracket and its corresponding counterpart.
Quick source code navigation - hold down the Ctrl key and right-click in the Scripting Editor to display a context menu listing all major building blocks of the currently loaded script including functions, rollouts, event handlers, UI elements, and more.
Variable text size - hold down the Ctrl key and turn the mouse wheel (if available) to adjust the size of the source code text.
For commands used within the Scripting Editor window, see Scripting Editor Commands.