2 Replies Latest reply on Sep 10, 2008 4:10 AM by sotospeak (carlo bazzo)

    How get persistent custom menus on the Main Menu Bar?

    sotospeak (carlo bazzo) Level 1
      Maybe an ingenuous question but..I create a new Indesign menu with:

      var mySampleScriptAction1 = app.scriptMenuActions.add("C");
      var mySampleScriptAction2=app.scriptMenuActions.add("B");
      var mySampleScriptAction3=app.scriptMenuActions.add("A");
      path_to_app=app.filePath.fsName;
      path_to_scripts=path_to_app+'/Scripts/myFolder/';
      mySampleScriptAction1.eventListeners.add("onInvoke",path_to_scripts+'C.jsxbin' , false);
      mySampleScriptAction2.eventListeners.add("onInvoke",path_to_scripts+'B.jsxbin' , false);
      mySampleScriptAction3.eventListeners.add("onInvoke",path_to_scripts+'A.jsxbin' , false);

      try{
      var mySampleScriptMenu = app.menus.item("$ID/Main").submenus.item("MyMenu");
      mySampleScriptMenu.title;
      }
      catch (myError){
      var mySampleScriptMenu = app.menus.item("$ID/Main").submenus.add("MyMenu");
      }
      mySampleScriptMenu.menuItems.add(mySampleScriptAction1);
      mySampleScriptMenu.menuItems.add(mySampleScriptAction2);
      mySampleScriptMenu.menuItems.add(mySampleScriptAction3);

      Everything is working fine, but if I exit Indesign when restarted I still get "MyMenu" on the Main Menu bar but no submenus if I click on it so that I can not run my scripts from menu anymore.

      It seems my menu is not persistent through Indesign sessions: did I miss something to have my menu permanent?

      carlo