MAXScript Introduction > The MAXScript Editor > MAXScript Editor Configuration And Customization >

# MAXScript Editor - Defining Custom Context Menu Items

| MAXScript Editor - Quick Navigation

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.

- Numeric IDs above 2000 are Scintilla commands and are sent to the focussed pane.

- Named IDs and numeric IDs below 2000 are SciTE menu commands.

- An Empty entry || defins a separator.

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.

- Let's first add a separator by placing two | delimiters and end the line with \ at the end of the user.context.menu definition in the MXS_Editor.properties file.

- Then we locate in the List of Named IDs the ID called "IDM_COPYASRTF".

- Let's add this command with label "Copy As RTF" to the context menu by adding to the user.context.menudefinition in the MXS_Editor.properties file. The final definition looks like this:

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

- Press CTRL+S to save the MXS_Editor.properties file.

- Open a MAXScript file and select some lines.

- Right-click in the Editor- the new separator and new menu item should appear!

- Select the item "Copy As RTF" to copy the selected text to the clipboard including all formatting.

- Now you can switch to an application like MS World and paste the text - it should appear in the same style!

| MAXScript Editor - Quick Navigation