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
When I run the script that you have in the box above I get
Is this not what you get? Try commenting out the first var setting the printerList and target illustrator like this
#target illustrator
//var printerList = app.printerList.Printer.name;
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();
I found this thread helpful
http://forums.adobe.com/thread/533408
In that example they are able to write the printers to a text frame (which does work on my machine). Any ideas as to how to write that list into an array I can populate a drop down with?
Thanks for all your help!
North America
Europe, Middle East and Africa
Asia Pacific