Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Print from Classic using native OS X printer drivers Classic
There have been a few other hints posted describing how to send jobs directly to CUPS via the command line. At the school where I work (with over 500 Macs), we've been using our own version of this idea since September, with great results.

Since most of our printers are on our network, rather than being connected locally, handing off print jobs from Classic to OS X allows us to:
  1. Eliminate all Classic printer drivers except for LaserWriter 8
  2. Print from Classic via TCP/IP easily
  3. Make clear to our users which printer they're printing to
This helps keep our administrative overhead down by letting us ignore Classic printing specifics, eliminate the Chooser, and keep AppleTalk (which never worked very well in OS X) turned off. The big difference between our method and those that have already been published is that we get feedback about our printing jobs through the regular Panther interface (i.e., the Printer Setup Utility and the printer proxy apps).

To set it up, do the following:
  1. Copy and paste this AppleScript into Script Editor. Compile the script, and save it into the /Library/Scripts/Folder Action Scripts folder. Give it a sensible name when you save; I call my installation "Print - choosing printer.scpt."

  2. Create a folder called "Classic Print Jobs" in ~/Library/.

  3. Control-click on the newly-created folder, and attach the newly-created script as a Folder Action.

  4. If Classic is running, quit it.

  5. Delete your "Printing Prefs" folder. This is either in /System Folder/Preferences/, or ~/Library/Classic/Preferences, depending on whether or not you've checked "Use Mac OS 9 preferences from your home" in the Classic Prefs pane.

  6. Launch Desktop Printer Utility -- a Classic app, probably in your /Applications (Mac OS 9)/Utilities/ folder. Choose "LaserWriter 8" from the pull-down menu, select "Translator (PostScript)" in the menu, and click "OK." In the next window, change the Default Destination Folder to the "Classic Print Jobs" folder created in step two. Then click the "Create..." button, and give the printer a sensible name (I use "OS X Printer").
Now, when you print from Classic, the Print dialog box will only let you print to a file, and will default to the "Classic Print Jobs" folder. When you save the file there, it will call up a list of the printer proxy apps in the "~/Library/Printers/" folder. These proxy apps are created whenever you print to a given printer, or create a Desktop Printer with the Printer Setup Utility app.

When you select a printer and click "OK," it sends that file to the chosen printer's proxy app. From there, printing proceeds as if it were an OS X print job. This has worked with every document type that we've tried -- text, color graphics, inkjets, laser printers, local printers, and networked printers all work equally well. If you find that it works well for you, then you can also delete all your other Classic printer drivers and the Chooser, as we have.
    •    
  • Currently 2.50 / 5
  You rated: 4 / 5 (4 votes cast)
 
[23,955 views]  

Print from Classic using native OS X printer drivers | 13 comments | Create New Account
Click here to return to the 'Print from Classic using native OS X printer drivers' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Print from Classic using native OS X printer drivers
Authored by: eagle on Mar 04, '05 09:50:47AM

I could really use this hint, but unfortunately it doesn't work for me. I get error -1304 when I try to run Desktop Printer Utility, and DPU crashes every time, no matter whether I choose "Continue" or "Quit" at the error dialog box.



[ Reply to This | # ]
Print from Classic using native OS X printer drivers
Authored by: lugal on Mar 04, '05 10:21:58AM
Try giving DPU more memory, and restart Classic for good measure. If that doesn't help, I've made a .zip archive of my copy of DPU that you can download from http://www.lugal.com/DPU.zip. (There's nothing special about this copy, I've just posted it in case yours is somehow corrupted.)

If that doesn't work, either, then I don't have any other ideas at the moment.

[ Reply to This | # ]

Print from Classic using native OS X printer drivers
Authored by: eagle on Mar 04, '05 05:31:04PM

Thanks - indeed it was a corrupted Desktop Printer Utility. And cool - I was able to modify your script to set the printer automatically (I only have one anyway) so now it just goes straight to the printer. Very cool - thanks. I could've used this like a year ago! But better now than never.



[ Reply to This | # ]
Print from Classic using native OS X printer drivers
Authored by: kyngchaos on Mar 04, '05 11:47:19AM

Sounds nice, but I see a problem - you lose any printer-specific settings in the Print dialog. You could choose a specific PPD for a printer when setting up the translator, but that would work for a single model of printer. You would have to make separate printer folders and change the script to automatically send to a particular printer.

We have a mix of laser printers and large and small format inkjets, and settings must be made for a specific printer or prints and plots have problems, especially from finicky applications such as QuarkXPress.

But a nice idea that I might play with when I get more of our office converted to Mac OS X.



[ Reply to This | # ]
Print from Classic using native OS X printer drivers
Authored by: lugal on Mar 05, '05 09:22:38AM

Though I haven't tried it, I'm pretty sure that you could get the results you're looking for by creating multiple instances of the desktop printer (step 6). Try creating each one w/ the PPD that you desire, and have each one default to a different folder. Then, if you copy the AppleScript and tweak it so that each copy sends the job to a specific printer, and attach the appropriate script as a folder action to each of the default folders, you should be good to go.

If you do this, then when you print from Classic, you can select multiple printers from the pull-down menu, and each one will default to a different folder, to be handled by a slightly different folder action.



[ Reply to This | # ]
Print from Classic using native OS X printer drivers
Authored by: stonetownmike on Mar 05, '05 10:41:06AM

Terrific hint! I was able to proof a Photoshop layout wirelessly from my kitchen to a USB print server hooked to a cheap Canon inkjet using CUPS and Gimp-print. Big breakthrough. Previously, I had to save the Photoshop file, reopen it in Preview or Graphic Converter in Panther, then print from there. (If only I could afford Photoshop for OS X...) Thanks!



[ Reply to This | # ]
Print from Classic using native OS X printer drivers
Authored by: barryjaylevine on Mar 06, '05 12:37:31AM

Maybe I'm not understanding the problem but I would suggest using PrintToPDF (which may be found here: http://www.jwwalker.com/pages/pdf.html ) and then simply dropping the resulting pdf onto the OSX driver's app (which, of course, you had the foresight to keep in your Dock even when not running).

Nothing else needed.

---
-----
Two things in this world aren't overrated: Macintosh and Lemon Meringue Pie.



[ Reply to This | # ]
Print from Classic using native OS X printer drivers
Authored by: chibiabos on Mar 12, '05 08:44:49AM

Works as advertised on my G5 and Epson CX4600 until the print job gets to the printer app. Then, the print queue automatically stops. Restarting the queue has no effect. Best I can do is convert the PostScript file to pdf and print from Acrobat or Preview. (It should be easier than this!)



[ Reply to This | # ]
Print from Classic using native OS X printer drivers
Authored by: squirri on May 19, '05 05:28:41AM

It works for me for the first file, then hangs - the second and other files never make it into the printer queue although they appear in the print jobs folder. This is printing fromoan OS9 machine to a G5 running Panther. Printer is a USB HP840C on the G5.

Bloody silly - all my windoze machines can use this printer just fine, but not my Macs!

I wonder if it's something to do with the script not cleaning up properly - if a second file arrives while the first is printing does that run a second copy of the script(sorry, I'm not used to the minutie of Applescript)



[ Reply to This | # ]
Print from Classic using native OS X printer drivers
Authored by: kreig303 on Mar 26, '05 02:23:19PM

Beautiful!

Works great for me, as well. I must admit, though, that there isn't much usefulness for me at this point in time (I converted to OS X Back in early '02--all my old documents have been since converted). However, it is nice to have this for that occasional, legacy, document.

Thanks a lot...



[ Reply to This | # ]
Print from Classic using native OS X printer drivers
Authored by: srmtlm on Mar 30, '05 06:08:47PM

I modified the script so that a specific printer is actually set in the script instead of displaying the dialog box to select a printer. The problem is it prints to that printer and then the script seems to get stuck. As folder actions quits responding and I have to force the system events to quit before I can get the folder actions to work again. Below is the script as I modified it. Being as I'm new to scripting I probably have some lines of code that aren't needed. Any help is appreciated. Thanks.

on adding folder items to this_folder after receiving added_items
set the_file to item 1 of added_items
-- the_file=file name placed in folder
if the_file is not ".DS_Store" then
-- check to make sure the file in the folder is no .DS_Store
set file_info to the info for the_file
-- file_info=file information of file placed in folder
set file_name to the name of file_info
-- file_name=name derived from file information of file placed in folder
set file_path to the POSIX path of the_file
-- file_path=unix path to the_file which is the postscript file placed in folder
set printer_path to path to home folder as text
-- printer_path=path to home but as text
set printer_path to printer_path & "Library:Printers:"
-- printer_path=path to home plus :Library:Printers:
set printer_list to list folder printer_path
-- printer_list=list of printer files in home:Library:Printers directory
set printer_names to {}
-- printer_names=nothing I guess
-- The next setting is the setting for which printer you want the file to come out of
set the_printer to "Phaser7300"
repeat with i from 1 to number of items in printer_list
set the_item to item i of printer_list
if the_item is not ".DS_Store" then
set item_name to text of characters 1 through ((length of the_item) - 4) of (the_item as string) as string
set printer_names to printer_names & item_name
end if
end repeat
if length of printer_names is 0 then
display dialog "No printers available. Print job canceled." buttons {"OK"} with icon caution default button 1
else
if the_printer is not false then
set printer_path to printer_path & the_printer & ".app:Contents:MacOS:PrinterProxy" as alias
set printer_path to POSIX path of printer_path
do shell script "\"" & printer_path & "\" \"" & file_path & "\"; rm \"" & file_path & "\""
else
do shell script "rm \"" & file_path & "\""
end if
end if
end if
end adding folder items to



[ Reply to This | # ]
Print from Classic using native OS X printer drivers
Authored by: rogersy@iprimus. on Aug 21, '06 05:33:22AM

Lugal
I must have Classic, and this Hint is terrific.
The only problem is the occasional corruption of the PrinterProxy application in my Printers folder, seemingly connected with new software downloads from Apple. The workaround is to delete the corrupted Printer Proxy application, reinstall my printer and print any OS X document, thereby creating a new PrinterProxy application.
It's a mystery — any ideas why this happens?



[ Reply to This | # ]
Print from Classic using native OS X printer drivers
Authored by: kelliebellie on Dec 12, '07 10:48:27AM

Hooray!!! This worked great!!! You've saved me about a thousand headaches and brought back all the excitement of getting my new printer. Thanks!!!!



[ Reply to This | # ]