I’m using a small script to setup printers automagically in a lab environment. Here’s the process…
-
At startup, force distribute files /etc/cups/printers.conf & printers.conf.0 as well as required ppd files in /etc/cups/ppd/
-
At login, logout & startup, run this script:
try
do shell script “rm /Users/MacAdministrator/.lpoptions”
end try
try
do shell script “/System/Library/StartupItems/PrintingServices/PrintingServices restart”
end try
OK, this works fine, except I want to add to the AppleScript the deletion of existing printers. So I add these lines at the beginning:
try
do shell script “lpadmin -x all”
end try
But, alas it does nothing, and in testing the command in the terminal I find that the “-x all” does not work. What happened to the “-x all” modifier for lpadmin in OS X? Is there some other way I can delete all current printers in a single line? Any other ideas?