6 Replies Latest reply on Apr 19, 2011 5:03 PM by Jimbo Jackson

    editable DropDownList?

    Jimbo Jackson

      I'm looking to do something like that which is done with a dropdownlist in Photoshop CS5 ->Automate -> Batch (script?), where one can type a custom text string directly in the dropdownlist (with any item of the dropdownlist being selected) , and while having the predefined items of the dropdownlist remain unchanged in number and value.

       

      Any ideas or suggestions of how this is accomplished would be much appreciated.

        • 1. Re: editable DropDownList?
          Marc Autret Level 4

          "ScriptUI for Dummies" from Peter Kahrel provides helpful snippets on customizing listbox and/or dropdownlist:

           

          http://www.kahrel.plus.com/indesign/scriptui.html

           

          E.g.:

          "Type-ahead lists: select while you type" (p. 26)

          "Selecting items in dropdowns using the keyboard" (p. 54)

           

          @+

          Marc

          1 person found this helpful
          • 2. Re: editable DropDownList?
            Jimbo Jackson Level 1

            Thanks, Marc! I reviewed the sections of Peter's guide that you suggested and it gave me some great ideas.

             

            So, my initial plan is to use an edittext control and a dropdownlist control, in stack orientation in the same container, with the edittext containter being the same width as the dropdown list, minus the width of the dropdownlist's arrow button. It would need a function to transfer the item that is selected in the dropdownlist to the edittext control if the user chooses a list item instead of typing something of their own in the edittext control.

             

            I'm not sure if this will work, as I have virtually zero experience with ScriptUI, but it'll be fun trying!

             

            Thanks again!

            • 3. Re: editable DropDownList?
              Peter Kahrel Adobe Community Professional & MVP

              Jimbo,

               

              This is definitely going to work, but there's a problem: on Windows, if you stack two objects, then the object that's dawn last is shown, but on Macs, the object drawn first is drawn. You can control for this using if (File.fs == "Macintosh").If you get stuck, I've got a working example to show how it works.

               

              Peter

              • 4. Re: editable DropDownList?
                Jimbo Jackson Level 1

                Peter, thanks for the warning about Windows vs. Mac! Cross compatibility issues are my biggest concern.

                 

                If I'm following you correctly, your workaround would go something like this:

                 

                if(File.fs = "Macintosh")

                {

                  container.add(objectOnTop);

                  container.add(objectBeneath);

                }

                else

                {

                  container.add(objectBeneath);

                  container.add(objectOnTop);

                }

                 

                 

                 

                Thanks for your help!!

                • 5. Re: editable DropDownList?
                  Peter Kahrel Adobe Community Professional & MVP

                  >  the workaround would go something like this:

                   

                  That's right.

                  • 6. Re: editable DropDownList?
                    Jimbo Jackson Level 1

                    I'm writing my scripts on a Windows XP Pro (32-bit) machine, and here is the result of the hybrid edittext/dropdownlist experiment I tried (thanks, again, Peter and Marc for your help!):

                     

                    ddlistmod.gif

                     

                     

                     

                     

                    And here is what a normal dropdownlist looks like in CS5 on my Windows machine. Can anyone who does their work on a Mac tell me if dropdownlists on a Mac look the same?

                     

                    ddlist.gif

                     

                     

                    Thanks!