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:
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:
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:
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:
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:
and that will modify the /etc/cups/lpoptions file.
Leave a Reply