3 Replies Latest reply on Oct 18, 2012 9:13 AM by Russ Ward

    Can't add a new menu

    Russ Ward Level 4

      Hi,

       

      (FM10, Win XP)

       

      Following the example in the scripting guide to add a menu with ES, I just can't get it to work. I expect the menu to appear after I run the script, which it does when I run the equivalent with the FDK. What am I missing here?

       

      var fmMainMenu = app.GetNamedMenu("!MakerMainMenu") ;

      var newMenu = fmMainMenu.DefineAndAddMenu("MyMenu1", "MyMenu1");

       

      I tried adding a command to the menu and get no errors, but the new menu still does not appear.

       

      Thanks,

      Russ

        • 1. Re: Can't add a new menu
          4everJang Level 3

          Hi Russ,

           

          Did you call UpdateMenus ( ) after adding the menus ?

           

          Ciao

           

          Jang

          • 2. Re: Can't add a new menu
            4everJang Level 3

            Also, I found that removing the menus again somehow never works. This means that in a first trial the menu with the name MyMenu1 might already be added - even though it is not visible - and the next run of your script cannot add the same menu anymore. Adding commands to the already existing - invisible - menu will work but never make any commands available. In my trials and errors with menus I was constantly restarting FM to get rid of the previous trial menus. I know there must be a better way but it seems that some script methods do not work.

             

            Good luck

             

            Jang

            • 3. Re: Can't add a new menu
              Russ Ward Level 4

              Jang,

               

              Thanks so much! That was it. Looking back at the sample, I see that I missed that part amidst all the other stuff. I thought I had read it through... apparently not.

               

              Russ