Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

To programmatically add to menus you can do as described here:

How do I add to menus?

What can I do to programmatically add to contextual menus? Is something similar to AddMenuCommands available?

share|improve this question

There's an option ContextMenu, which you seem to be able to set at cell, notebook, or even box level. They all default to something like

FEPrivate`FrontEndResource["ContextMenus", "something"]

That info seems to be in the file in the $InstallationDirectory, SystemFiles, FrontEnd, TextResources.

In any case, all that that option needs is a list of MenuItem[...]. You can look at that file (or at to get a hang on the syntax. Then it's just setting the option.

Apart from the brute force method of reading the file, creating your own, adding your Menus, and setting that option, I still haven't found a way to "append" the MenuItems. Only to replace... I'll edit if I find something

share|improve this answer
You're can't append menu items. But you missed a second source of context menus...the ComponentwiseContextMenu option. ContextMenu is used where you can easily dictate context menus by style, whereas ComponentwiseContextMenu allows you to determine context menus which belong to certain box types, the various cell-related widgets, etc., which may be difficult or impossible to apply styles to. – John Fultz Mar 6 '12 at 15:52

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.