Function Repository Resource:

RemoveMenuItem

Source Notebook

Remove a menu item added with AddMenuItem

Contributed by: Wolfram Staff

ResourceFunction["RemoveMenuItem"]["name"]

removes the menu item "name" added with the resource function AddMenuItem.

Details and Options

In ResourceFunction["RemoveMenuItem"]["name"], "name" refers to the name of the first element of the MenuItem expression used in ResourceFunction["AddMenuItem"]["after",{,MenuItem["name",]}].

Examples

Basic Examples (2) 

Add a menu item:

In[1]:=
ResourceFunction["AddMenuItem"]["WindowMiniaturize", MenuItem["CloseOthers", KernelExecute[
   SetOptions[InputNotebook[], WindowMargins -> {{0, 0}, {0, 0}}, WindowSize -> Automatic]], "MenuKey"["m", "Modifiers" -> {"Shift", "Control"}], MenuEvaluator -> "System"]]

Remove the item:

In[2]:=
ResourceFunction["RemoveMenuItem"]["CloseOthers"]

Add two menu items and delete them:

In[3]:=
ResourceFunction["AddMenuItem"]["SelectionHelpDialog", {Delimiter, MenuItem["Function Repository", FrontEndExecute[{FrontEnd`NotebookLocate[{URL[
        "https://resources.wolframcloud.com/FunctionRepository/"], None}]}]]}]
In[4]:=
ResourceFunction["RemoveMenuItem"]["Function Repository"]

Possible Issues (1) 

RemoveMenuItem does not work for built-in menu items or any other items added outside ResourceFunction[“AddMenuItem”]:

In[5]:=
ResourceFunction["RemoveMenuItem"]["Undo"]
Out[5]=

Version History

  • 1.0.0 – 12 November 2020

Related Resources

License Information