I placed the following code in a init.m notebook that executes upon Mathematica startup. This creates a shortcut menu command that allows me to insert a page break by pressing Control+p. You can see the shortcut in the insert menu dropdown.
FrontEndExecute[FrontEnd`AddMenuCommands["DuplicatePreviousOutput",{MenuItem["Page Break",FrontEnd`KernelExecute[NotebookWrite[InputNotebook[],Cell["", "PageBreak", PageBreakBelow -> True],After]],FrontEnd`MenuKey["p",FrontEnd`Modifiers->{"Control"}],System`MenuEvaluator->Automatic]}]]; Let's say I want to change the shortcut from Control+p to Control+l. If I run the init.m file again with the modified code while Mathematica is already running it keeps the old shortcut which I don't want. You can see both by clicking the insert drop down menu.
Is there a way to erase the first shortcut by executing the init.m file without rebooting Mathematica? That is is there a command I can put at the top the init.m file that will erase the previous version?
I want to reinitialize so that erases the previously executed shortcut and installs the new one without rebooting? Any help would be greatly appreciated.