MAXScript Editor - Defining Custom Context Menu Items

The Tabbed MAXScript Editor introduced in 3ds Max 2008 lets you define your own custom Context (Right-Click) Menu Items in addition to the hard-coded items like Undo, Redo, Copy and Paste.

This is the default context menu which appears when you right-click in the Editor window:

Definition:

Custom context menu items can be defined in the file MXS_Editor.properties which is easily accessible via the Tools > Open Global Options File menu item.See MAXScript Editor - Properties File Settings for all options.

The definition starts with

user.context.menu=\

and is a '|' delimited list of menu item names and the commands they produce.

To place each command on a new line, add a backslash \ at the end of each line.

FOR EXAMPLE,

   user.context.menu=\
   Next File |IDM_PREVFILE|\
   Prev File|IDM_NEXTFILE|

Note that the above definition is available by default in the Global Options file but is remarked and thus disabled by default. You can remove the # remark symbold from all lines to enable it.

The commands are either strings or numeric IDs -see List of Editor Key Commands and List of Editor Menu Commands.

Other than keyboard shortcuts, changes to user-defined context menu definitions become active immediately and do not require a restart!

Adding a new user-defined keyboard shortcut

Let’s assume you want to add a menu item for the editor feature "Copy As RTF". This feature is already listed in the Edit menu but could be placed closer to the mouse for easier copying of formatted colored text between the Editor and external word processing applications.

   user.context.menu=\
   Next File |IDM_PREVFILE|\
   Prev File|IDM_NEXTFILE|\ | |\ Copy As RTF|IDM_COPYASRTF|