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

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

    booyajamo

      Hello,

       

      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");
      w.center();
      w.show();
      

      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?

       

      Thanks,

      Lindsay