0

I have created a MenuItem that switches Wholecellgroupopeners On and Off for the currently selected notebook using the Control+w shortcut.

FrontEndExecute[
 FrontEnd`AddMenuCommands["DuplicatePreviousOutput", {Delimiter,
   MenuItem["WholeCellGroupOpener",
    FrontEnd`KernelExecute[
     SetOptions[SelectedNotebook[], 
      "WholeCellGroupOpener" -> ! 
        CurrentValue@
         Options[SelectedNotebook[], "WholeCellGroupOpener"]]], 
    MenuKey["w", Modifiers -> {"Control"}], 
    System`MenuEvaluator -> Automatic]}]]

It would like to install this MenuItem in the FrontEnd so that it's installed at every startup. I can't seem to make it work. The MenuItem never shows up. From other posts that I am reading it seems that I need to:

  1. Save this as an init.m file and
  2. Place it somewhere in the startup path

I tried and failed. Can you help me? Maybe I'm not saving the file as a init.m file correctly. Do I need to use Xcode? Also, where is the best place to store the init.m file?

Can I store it somewhere in the user/library/mathematica/ path or does it need to go in the path Applications/Mathematica/Content/ path? I would prefer the former.

B flat
  • 5,523
  • 2
  • 14
  • 36
  • 1
    Is this the answer https://mathematica.stackexchange.com/q/1606/5478? – Kuba May 24 '18 at 04:59
  • 1
    But maybe better to edit MenuSetup.tr directly since it is meant to persist? – Kuba May 24 '18 at 05:03
  • I didn't see that! Thank you. I'm confused. Doesn't placing the init file in the right place make it permanent? – B flat May 24 '18 at 05:22
  • 1
    It does, it is 'here is a menu layout to use vs. modify default menu each time you launch'. – Kuba May 24 '18 at 06:26

0 Answers0