7 Replies Latest reply on Feb 2, 2011 3:43 PM by DimitriM

    app.execmenuitem() Bug?

    mmrm

      Using acrobat 8 pro in the console I enter...  app.execMenuItem("Annots:ShowStampsPalette");

       

      I get an error:

       

      InvalidArgsError: Invalid arguments.

      app.execMenuItem:1:Console undefined:Exec

      undefined

       

       

      If I manually navigate to the menu item and select it the menu item appears as expected, if I then go back to the console and enter the same command it works.  Is this a bug?  It seems like something gets initiated behind the scenes after the manual navigation.  Is there a way to circumvent this?

        • 1. Re: app.execmenuitem() Bug?
          try67 MVP & Adobe Community Professional

          Did you use app.listMenuItems to make sure there's actually a menu item with

          that name?

          • 2. Re: app.execmenuitem() Bug?
            mmrm Level 1

            Yes.  Its legit.  And like I said after I do it once manually it works over and over until I restart the program.

            • 3. Re: app.execmenuitem() Bug?
              George_Johnson MVP & Adobe Community Professional

              mmrm wrote:

               

              It seems like something gets initiated behind the scenes after the manual navigation.  Is there a way to circumvent this?

               

              That could be. Try doing something having to do with the annots, such as:

               

              getAnnots();

               

              before your execMenuItem call.

              • 4. Re: app.execmenuitem() Bug?
                mmrm Level 1

                That seemed like a good idea but no luck.

                • 5. Re: app.execmenuitem() Bug?
                  DimitriM Level 3

                  Hi mmm,

                   

                  The problem is those menu items don’t exist when Acrobat starts up- you must walk the menu item to initialize them. After doing that they work until you close Acrobat.  This is not a bug- it is by design.  Further, if you move to Acrobat X those menu items don’t exist at all so you can’t initialize and it’s pretty much a dead methodology

                   

                  Hope this helps,

                   

                  Dimitri

                  www.pdfscripting.com

                  www.windjack.com

                  • 6. Re: app.execmenuitem() Bug?
                    mmrm Level 1

                    There is not a stamp palette in the newer version?  That seems strange...

                     

                    Is there another way to initialize them?  If its by design theres gotta be another way around it.

                    • 7. Re: app.execmenuitem() Bug?
                      DimitriM Level 3

                      Hi mmm,

                       

                      Yes, there is a stamp palette in Acrobat X, but it is not based on the old menu item structure.  Most of the Menu Items are no longer available in Acrobat X- they were replaced with the new Flash tool panels.

                       

                      We've been through this subject fairly thoroughly and there is no way around it. My company has developed tools for clients where menu items such as custom stamps are used so many times per day they decided they could live with walking the menu once at the start of each session.  But of course it's not optimal.  The only thing that made it palatable is the large number of times a tool is used.  We know of no way to circumvent it, sorry.

                      If you find a way let us know!

                       

                      Hope this helps,

                       

                      Dimitri

                      www.pdfscripting.com

                      www.windjack.com