-
1. Re: [JS][CS4] - populating a drop down with list of printers?
Larry G. Schneider Mar 27, 2012 9:53 AM (in response to booyajamo)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(); -
3. Re: [JS][CS4] - populating a drop down with list of printers?
Larry G. Schneider Mar 27, 2012 5:25 PM (in response to booyajamo)What OS? It appears a PC; I'm on a Mac. Maybe that's the difference.
-
4. Re: [JS][CS4] - populating a drop down with list of printers?
booyajamo Mar 27, 2012 7:07 PM (in response to Larry G. Schneider)Naw, I'm on a Mac too.
OS X 10.7.3
hmmmm......
-
5. Re: [JS][CS4] - populating a drop down with list of printers?
booyajamo Mar 27, 2012 7:44 PM (in response to booyajamo)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!
-
6. Re: [JS][CS4] - populating a drop down with list of printers?
CarlosCanto Mar 28, 2012 8:28 AM (in response to booyajamo)in that thread example, I added this two lines to write the names to an array
var arrayPrinterNames = []; // added for (var i = 0; i < iCount; ++i) { arrayPrinterNames.push(app.printerList[i].name); // added -
7. Re: [JS][CS4] - populating a drop down with list of printers?
CarlosCanto Mar 29, 2012 12:13 AM (in response to CarlosCanto)it also takes forever in my system, so I would add the following line
var pL = app.printerList;
and use pL to avoid multiple calls to the system. for example
var arrayPrinterNames = []; for (var i = 0; i < iCount; ++i) { arrayPrinterNames.push(pL[i].name); -
8. Re: [JS][CS4] - populating a drop down with list of printers?
booyajamo Mar 29, 2012 4:22 AM (in response to CarlosCanto)Thanks Carlos!
I was finding that my system was taking forever to load the printer names as well and I thought maybe it was unique to my machine so thanks for mentioning yours was the same.
Thanks for your help!
Lindsay





