A MacroScript is generated automatically when scripting code (from the MacroRecorder output, from the MAXScript Listener or from a MAXScript editor) is dragged and dropped onto a toolbar. The new scripts have the extension .mcr and are written by default to the #userMacros folder (see 3ds Max System Directories).
The location of the #userMacros folder is configured via Main Menu > Customize > Configure System Paths > Additional Macros. It can be revealed by typing in the MAXScript Listener
To create a MacroScript using Drag And Drop:
Result: A new button will be created, showing a generic MacroScript icon. The new script will be named "MacroN" where N is a unique number incremented after each drag and drop operation. The category of the new script will be "DragAndDrop".
You can also use MacroScripts as ActionItems in Menus, QuadMenus, Toolbars and Keyboard Shortcuts.
Of course, a script developer can write the same form of scripts manually or use automatically generated MacroRecorder code as template for manual enhancements. The developer’s source code might also be contained in an .ms file.
A typical MacroScript will usually start like this:
Note the category: name. You will need this name in order to be able to quickly locate the script in the Customize dialog.
Alternatively, go to the Utilities panel, open the MAXScript Utility, press Open Script...
An evaluated MacroScript appears in the Customize... dialog’s categories list of Action Items. The evaluated version of the script remembers its source’s location. As soon as a MacroScript definition is evaluated, a copy of the source is automatically saved in the #userMacros folder with a new name comprised of the Category Name, the MacroScript’s name and the .mcr extension.
If you change or update the script by evaluating a newer / different version with the same name and category, the copy of the script in the #userMacros folder will be overwritten with the actualized version.
All scripts in #macroScripts which contains the factory-defined MacroScripts and #userMacros containing the user-defined ones will be automatically evaluated on startup and will be available to the user in future sessions. To remove a MacroScript permanently, you should remove the respective .mcr file from the #userMacros folder.
It is not advisable to have any MacroScript sources in auto start folders like the #startupScripts or the plug-in paths as this would mean a double evaluation of the same source code from two different locations. Store sources of MacroScripts (your own creations, free downloads from the web or commercial scripts) at paths that are not listed in your Configure Paths dialog. This way only the automatically managed content of the #macroScripts and #userMacros folders will be used by 3ds Max.
MAXScript for New and Casual Users
Scripted Utilities for New Users
Scripted Plug-ins for New Users
Scripted Functions for New Users
MAXScript DLX Extensions for New Users