Default printer options for Mac OS X

If you ever want to script default printing options for OS X, these commands should help you out.

User: Switching to a default printer instead of the last used printer

By default, Mac OS X will make the default printer whatever printer was last used. If you’d like to change that setting for the user, this command will do it:

defaults write org.cups.PrintingPrefs UseLastPrinter -bool False

Note: this user setting will take precedence over the global setting.

Global: Switching to a default printer instead of the last used printer

If you want to change the global setting, it’s this command:

sudo defaults write /Library/Preferences/org.cups.PrintingPrefs UseLastPrinter -bool False

User: Specifying the default printer

The actual user-specified default printer lives in the /Users/username/.cups/lpoptions file, but you change the default printer with this command:

lpoptions -d NameOfPrinter

Just substitute in the actual name of the printer for NameOfPrinter.

Note: the actual name of the printer to substitute in may not be exactly how you see it in System Preferences > Printers & Scanners.

If you have trouble reconciling the name, this command will list out the available printers, and their actual (not just visible) names:

lpstat -p -d

Global: Specifying the default printer

As with the previous setting, the user setting will override the global setting, but you may still want to have a global default setting.

It’s basically the same command, but you just run it with escalated privileges:

sudo lpoptions -d NameOfPrinter

and that will modify the /etc/cups/lpoptions file.


Posted

in

by

Comments

One response to “Default printer options for Mac OS X”

  1. Gordon Avatar
    Gordon

    Thanks for publishing this super helpful !!

Leave a Reply

Your email address will not be published. Required fields are marked *