8 Replies Latest reply on Mar 29, 2012 4:22 AM by booyajamo

    [JS][CS4] - populating a drop down with list of printers?

    booyajamo Level 1



      I'm trying to populate a drop down field with the list of available printers. Here's what I have:


      var printerList = app.printerList;


      var w = new Window ("dialog");
      w.orientation = 'row';
      var dropDown = w.add("statictext", undefined, "Please select the printer");
      var dropDown = w.add ("dropdownlist", undefined, printerList);
      dropDown.selection = 0;
      var buttonGroup = w.add ("group");
      buttonGroup.add ("button", undefined, "OK");

      This will populate a drop down with "Printer, Printer, Printer, Printer" for each printer instead of the name of the printer (which is what I want).


      When I try:


      var printerList = app.printerList.name;


      I get a drop down of blank entries.


      Any ideas on what I'm doing wrong?  How exactly does the printerList work?