You can open a script file for editing, or you can include it in another script to run automatically when that script runs.
Reset 3ds Max.
Go to the Utilities panel, turn on MAXScript, and in the MAXScript rollout, click the Run Script button.
The Choose Editor File dialog appears.
Select the box_draw.ms file, and click Open.
MAXScript immediately carries out the command that is contained in the script file and places a box in the scene.
If you want to edit your script later to add more commands to it, you need to open it:
In the MAXScript rollout, click the Open Script button
Select the script you want to edit and click Open.
The Script Editor window opens, showing the text of your script. You can now edit your commands or add new ones, as you would edit any other text file. Save the script file to keep your changes.
If you enter any commands in the Script Editor window manually (not by copying and pasting from the Listener window), you can test the validity of all commands:
If your Listener window isn't open, click the Open Listener button in the MAXScript rollout.
In the Script Editor window, choose File > Evaluate All.
MAXScript evaluates the commands in your script file. It sends any feedback to the Listener window. It also sends each valid command to the user interface as if you had run the script. If your script contains any syntax errors, MAXScript reports those in the Listener window in red.
If you want to write a script for each tutorial (for example one for drawing a box, one for modifying the box, and another one for transforming it), you could then use those three scripts in another one that contains all the box operations. Assuming you had created the scripts box_draw.ms, box_mod.ms, and box_trans.ms, you could then include them in a new script, box_all.ms. The text for box_all.ms would be as follows:
If you want to start with a new scene before running any scripts, you need to reset the software:
Choose File > Reset.
Answer the Yes-No prompt to either save or discard the changes to your scene.
Open and run the script you want.
Note that resetting the software closes all MAXScript windows so that you can't copy any more commands from the Listener window. You can always copy commands from the help file, as described below.
You can copy commands from the tutorial help file:
In the Help window, highlight the command you want to copy.
Right-click the highlighted text and select Copy from the pop-up menu.
In the Script Editor window, choose the Edit > Paste menu to paste the command into the current script file, or press CTRL+V on your keyboard.
Loading Other Scripts