2 Replies Latest reply on Apr 19, 2012 2:19 AM by cappelluti

    Customized menu doesn't work when inDesign restarted

    cappelluti

      Hi,

      I'm quite new to this forum. I'd like to customize my inDesign menu with the following script:

       

       

       

       

      var cartella_scripts = Folder(app.activeScript.path);

      app.menus.item("$ID/Main").submenus.add("Enzo's");

       

       

      //ADD INFO PUBBLICAZIONE

      nuova_voce = app.scriptMenuActions.add("SUBMENU1");

      myEventListener = nuova_voce.eventListeners.add("onInvoke", function(){

          cartella_scripts1=cartella_scripts

          app.doScript(File(cartella_scripts1 + '/INFO PUBBLICAZIONE.jsx'));

       

      });

      mySampleScriptMenu = app.menus.item("$ID/Main").submenus.add("Enzo's");

      mySampleScriptMenuItem = mySampleScriptMenu.menuItems.add(nuova_voce);

       

       

      //ADD EVIDENZIA STILI

      nuova_voce = app.scriptMenuActions.add("SUBMENU2");

      myEventListener = nuova_voce.eventListeners.add("onInvoke", function(){

          cartella_scripts2=cartella_scripts

          app.doScript(File(cartella_scripts2 + '/EVIDENZIA STILI.jsx'));

      });

      mySampleScriptMenu = app.menus.item("$ID/Main").submenus.add("Enzo's");

      mySampleScriptMenuItem = mySampleScriptMenu.menuItems.add(nuova_voce);

       

       

      //ADD GESTISCO COPERTINE

      nuova_voce = app.scriptMenuActions.add("SUBMENU3");

      myEventListener = nuova_voce.eventListeners.add("onInvoke", function(){   

          cartella_scripts3=cartella_scripts.parent + '/personal_folder'

          app.doScript(File(cartella_scripts3 + '/GESTISCI COPERTINE.jsx'));

      });

      mySampleScriptMenu = app.menus.item("$ID/Main").submenus.add("Enzo's");

      mySampleScriptMenuItem = mySampleScriptMenu.menuItems.add(nuova_voce);

       

       

       

       

      If I run this script, it works. So I can see, and use, the menu group (Enzo's) with it's submenus (SUBMENU1, SUBMENU2 and SUBMENU3).

      My problem is when I close and open again inDesign. If I don't run again the script I'll see the menu group (Enzo's) but I can't see the submenus.

       

      Can I avoid to run the script everytime I open inDesign?

       

       

      Thank you very much.

       

      Enzo Cappelluti