Classic mode Desktop Printers on Mac OS X
Classic mode Desktop Printers on Mac OS X
- Subject: Classic mode Desktop Printers on Mac OS X
- From: Jason Filice <email@hidden>
- Date: Thu, 25 Apr 2002 18:00:13 -0700
I need to be able to script the PostScript printer settings in Classic on
Mac OS X in a lab environment. I want to be able to make changes to the
selected default printer, deleting incorrect printer queues, and making new
ones.
I already have a script that runs in native Mac OS 9 and tells the Desktop
Printer Manager. However, in OS X, the Desktop Printer Manager does not
seem to respond correctly to commands.
For example, in the script I ask for a list of all the desktop printers and
the result is an empty list. It also does not change the default printer,
delete desktop printers, nor make new ones.
I am aware that in Classic mode, desktop printing is not supported, but
rather the older Print Monitor application handles queues. I also know to
use the Chooser to manually select AppleTalk PostScript printers and Desktop
Printer Utility to set up LPR printing.
However that is not good enough in an environment in which I want to have
the chosen printer queues maintained automatically. I have considered
restricting access to the Chooser and the Desktop Printer Utility, but that
is a really crummy way to do it, and not very fool proof.
Below are some examples of some of the code I used in Mac OS 9, but
unsuccessfully in OS X. It is pretty typical for what I am trying to
accomplish:
--get a list of all desktop printers
tell application "Desktop Printer Manager"
set every_DTP to (every desktop printer)
end tell
--delete all desktop printers
tell application "Desktop Printer Manager" to delete every desktop
printer
--set the default printer to the desktop printer whose name is
default_printer_name
tell application "Desktop Printer Manager"
get every desktop printer whose name is default_printer_name
set default_printer to the result
log result
if the (count of the default_printer) is 1 then
set the default printer to the default_printer
else if the (count of the default_printer) is greater than 1 then
set the default printer to the first item of the default_printer
end if
end tell
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.