I’ve worked out through googling how to set my default printer on Yosemite, but I’d like to be able to check if the printer is actually accepting jobs. The information is listed in the shell scripts returned data, but I can’t find a way to retrieve the setting as a property. Is such a thing possible, or should I parse the data to check for true? Parsing seems such an awkward method.
use AppleScript version "2.3.1"
use scripting additions
use framework "Foundation"
use framework "AppKit"
on run
setPrinter()
end run
on setPrinter()
set defaultPrinterProperties to do shell script ("lpoptions -d Quark_Printer")
set defaultPrinter to do shell script ("lpstat -p Quark_Printer")
defaultPrinterProperties & return & return & defaultPrinter
end setPrinter
Result of Main Script:
--> "copies=1 device-uri=
dnssd://HP LaserJet 200 color M251nw (4C7452)._ipp._tcp.local. finishings=3 job-cancel-after=10800 job-hold-until=no-hold job-priority=50 job-sheets=none,none marker-change-time=1412906605 marker-colors=#00FFFF,#FF00FF,#FFFF00,#000000 marker-high-levels=100,100,100,100 marker-levels=100,96,100,87 marker-low-levels=6,6,6,7 marker-names='Cyan\\ Cartridge\\ HP\\ CF211A,Magenta\\ Cartridge\\ HP\\ CF213A,Yellow\\ Cartridge\\ HP\\ CF212A,Black\\ Cartridge\\ HP\\ CF210X' marker-types=toner,toner,toner,toner number-up=1 printer-commands=AutoConfigure,Clean,PrintSelfTestPage printer-info='Quark Printer'
printer-is-accepting-jobs=true printer-is-shared=false printer-location printer-make-and-model='HP LaserJet 200 color M251nw-AirPrint' printer-state=3 printer-state-change-time=1412906673 printer-state-reasons=cups-ipp-conformance-failure-report,cups-ipp-missing-send-document printer-type=10522828 printer-uri-supported=
ipp://localhost/printers/Quark_Printer
printer Quark_Printer is idle. enabled since Fri Oct 10 13:04:33 2014"