2 Replies Latest reply on Oct 3, 2011 1:07 AM by try67

    Import text file into combobox in Acrobat

    jay fresno Level 2

      Does anyone know of a script or other method to import a text file into a combobox in Acrobat X?

      I have a long list that I'd prefer not to have to retype one at a time into the Options list in Acrobat.

        • 1. Re: Import text file into combobox in Acrobat
          maxwyss Level 4

          There are several possibilities. Does it need to be automated, or is it just every now and then, when you work on the file?


          For manual every now and then, you could for example pepare the list as JavaScript code. In the first step, you pepare the list as an array (see Acrobat JavaScript documentation, entry for setItems() in the Field chapter). Then you add the code for setting it to the field. This would kind of look like


             var myItems = [

              [item1, return1],

              [item2, return2],


             [itemLast, returnLast]

             ] ;


             this.getField("myComboBox").setItems(myItems) ;


          You then open the console, copy the whole code into the Console, and execute the whole code in one step.



          If you have to do the same quite often, but always with the same values, you could create a custom menu item and then run this code from the menu (or the toolbar)



          Another possibility would be preparing an FDF which runs the above code when it gets imported into your document. This would also have the possibility to modify the list whenever you load it into the form.



          And if you prefer buy over make, you might talk to Appligent; I believe to remember that they have an utility which allows you to take a text file and turn it into the options list for your combox.


          Hope this can help.


          Max Wyss.

          • 2. Re: Import text file into combobox in Acrobat
            try67 MVP & Adobe Community Professional

            I've developed a script that does exactly that. Have a look here: