2 Replies Latest reply on May 19, 2011 2:14 PM by gkaiseril

    Get specific Children from MenuItems, Acrobat X




      Thanks in advance for any help.


      I need to get an array from a specific menu item, and assign a variable to each. There are 50 Children in the menu item. Previously, I could just call the MenuItem as they were static. With current versions of software, the children names sometimes change.


      So for example only, menu item "Page Navigation"


      GoTo //menu item name is GoTo, need array of the children
      ** FirstPage //need to assign var1
      ** PrevPage //need to assign var2
      ** NextPage //need to assign var3
      ** LastPage // and so on.
      ** GoToPage
      ** endPageNavGroup
      ** GoBack
      ** GoForward


      Then I would execute the menu item in a priveledged context using the assigned name var1.


      Thanks for viewing
        • 1. Re: Get specific Children from MenuItems, Acrobat X
          gkaiseril MVP & Adobe Community Professional

          Generate a list of the menu items' "Cname" property. It will show all name used by Adobe, assigned by JavaScirpt, added by 3rd parties and list them for the old menu items no longer visible.


          Look at the examples in the Acrobat JS API on how to the array or menu items and the properties of the menu item.


          • 2. Re: Get specific Children from MenuItems, Acrobat X
            kentgbaker Level 1

            Thanks George,


            I can generate a list of ALL the menu items. What I am struggling with is to just get the one I want. If I can get an array of just the children of the menu item I want, make each a variable, then I avoid the un-predictable naming that I am currently experiencing.


            i.e acrobat loads and the first child is called menuItem_1 or menuItem_111, I will have assigned a known value to it.


            I know I am not explaining myself well enough. In my dreams it would be something like:


            var myArray = [app.listToolbarButtons(theMenuItemIwant.oChildren)];


            Please stay tuned, I need your help