Share

Scripting Editor Window

The Scripting Editor is a built-in editor you can open within 3ds Max and use to create or edit text files, notably MAXScript and Python script files. Scripts can be executed from the editor. The editor also provides syntax highlighting for other common text formats, like HTML and XML.

To open the Editor,

  • Click MAXScript > Scripting Editor... in the 3ds Max Main Menu to toggle the new Editor window. Any scripts that have been open for editing will be kept in the Editor, even between 3ds Max sessions.
  • Click MAXScript > New Script in the 3ds Max Main Menu to start a new script, or
  • Click MAXScript > Open Script in the 3ds Max Main Menu and select an existing script from disk to load in the Editor, or
  • Press the New Script or Open Script buttons in the MAXScript Utility rollout, or
  • Select File > New Script or File > Open Script in the Scripting Listener's menu bar or
  • Right-click the Mini-Listener and select Open Editor Window.

MAXScript opens the selected script in a tab inside the modeless Scripting Editor window:

The Scripting Editor is suited for developing longer scripts or code fragments you want to keep. You can edit and test parts of them until they are complete, then save your code in a script file for later use. This is a common method for developing large scripts, utilities, and function libraries.

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.

You can open a Scripting Editor tab from within the Listener or from other running scripts by calling the edit() method. The syntax for the edit() method is:

edit <filename_string>

where <filename_string> is a string literal or an expression that evaluates to a string, and specifies the name of the file whose contents are to be loaded into the new Scripting Editor window.

EXAMPLE

   edit "my_script.ms"

or

   scriptfile="my_script.ms"
   edit scriptfile

The file will be searched for in the following directories, in the order listed:

  • The current MAXScript directory

  • The 3ds Max executable main directory

  • The Windows NT 32-bit system directory (system32)

  • The Windows 16-bit system directory (system)

  • The Windows directory

  • The directories that are listed in the PATH environment variable

The MAXScript System Global Variable editorShowPath controls whether the Scripting Editor will display the full path of the edited script (true) or only the file name in the title bar (false).

Was this information helpful?