MacOS – Printer Setup Utility gone in Mavericks, how to set default printer in Applescript now

applescriptmacosprinting

I have some Applescripts that set the default printer using "Printer Setup Utility", that seems gone in Mavericks.

Anyone have an alternative to suggest?

Best Answer

You can use AppleScript to execute shell scripts, so you can use:

do shell script ("lpoptions -d printername")

Replace printername with the actual printer name. It may not be exactly as it shows in System Preferences (I think ALL non-alphanumeric characters are replaced with underscores, but I'm not certain) so you can view your list of printers with:

lpstat -p