Use AppleScript to set default printer
Fri, Oct 11 2002 at 9:22AM PDT • Contributed by: steve_rothman
Fri, Oct 11 2002 at 9:22AM PDT • Contributed by: steve_rothman
You can use Print Center to designate which printer should be the current (default) printer, which is easy enough. But you may want to do it via AppleScript for automation purposes. If so, here's an example script that will show you all the configured printers, with the current printer highlighted. You can pick a different printer if you want, click OK, and there will be a new current printer.
tell application "Print Center"Works on Mac OS X 10.2, not sure about 10.1?
set printerlist to name of printers
set oldprinter to name of current printer
set printerchoice to (choose from list printerlist with prompt ¬
"Which printer to be default?" default items oldprinter)
set myprinter to printer (printerchoice as string)
set current printer to myprinter
end tell
•
[12,653 views]
