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

10.4: Automate 'print to file' printing from Classic Classic
When I recently changed my workplace printers, I couldn't install the new printers in Classic. Since I print very seldom from Classic (but I do have one program that I have to use), I just used the Print to File option, and then printed the .ps file with in OS X. Then I realised that I could simplify things with the help of a LaunchAgent and a QueueDirectory.

To achieve this, I started by making a small script that prints all files in a directory and removes them:

# Script to be called by launchd that prints all files 
# in the folder ~/classicprint/ and then deletes them

sleep 30
lp ~/classicprint/*
rm ~/classicprint/*
I saved the script as, and put it in my home directory and made it executable with chmod a+x ~/ I also made a new directory in my home drectory and called it classicprint.

To make the LaunchAgent, I used Lingon by Peter Borg. Using the Assistant, I chose to "Run an application/script when something is added to a folder." I added a nice label in step two, and finally chose the script as "Application/Script," and the folder classicprint as Watch Folder. The resulting plist-file looks like this.

If you don't use Lingon, paste that text into a text editor, change the ProgramArguments and QueueDirectories entries to match your system. Save in ~/Library/LaunchAgents with a suitable name ending in .plist. Then type this command in Terminal to load the agent:
launchctl load ~/Library/LaunchAgents/yourplist.plist
This could most certinely be solved with a Folder Action in the Finder as well, but this is how I did it. The sleep 30 command in the script is to give Classic time to finish printing. In my tests, it looked like the LaunchAgent was invoked as soon as the file was starting to be written to. This could also probably be fixed in a smarter way, but since I have more than a 30 second walk to the printer, this simple workaround does it for me.
  • Currently 2.07 / 5
  You rated: 5 / 5 (15 votes cast)

10.4: Automate 'print to file' printing from Classic | 4 comments | Create New Account
Click here to return to the '10.4: Automate 'print to file' printing from Classic' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.4: Automate 'print to file' printing from Classic
Authored by: emendelson on Oct 06, '06 08:12:05PM

Isn't this hint completely unnecessary under 10.4? Under 10.4, you don't have to install drivers for your printer in Classic. All you need to do is this:

In Classic, go to the Apple menu, then Chooser, and, in the left-hand window, choose LaserWriter8. You need not select anything in the right-hand window. Then print normally from your OS 9 application. The printer that is named at the top of the Print dialog should be your default OS X printer.

More on this from Apple's site:

[ Reply to This | # ]
10.4: Automate 'print to file' printing from Classic
Authored by: fredrikw on Oct 09, '06 05:12:54PM

This certainly sounds a lot easier, if not all that obvious!

I couldn't get it to work when I tried though, maybe because I already had some printers installed, but I couldn't just select LaserWriter 8 without selecting one of the printers to the right. And when I chose to print from Classic, I only got the selected printer, not the ones from OS X.


[ Reply to This | # ]
10.4: Automate 'print to file' printing from Classic
Authored by: emendelson on Oct 09, '06 07:14:22PM

Well, this is absolutely guaranteed to work if your system is working correctly, and works for absolutely every Classic application I've tried. Perhaps you need to clean out the older printer drivers - download Printer Setup Repair, go to Classic Mode Management, and delete the contents of the Printer Preferences folder. Then restart Classicc.

[ Reply to This | # ]
10.4: Automate 'print to file' printing from Classic
Authored by: emendelson on Oct 09, '06 07:16:37PM

I forgot to mention that in the Chooser, you simply click on LaserWriter 8 in the left panel and then close the window by pressing Ctrl-W. You do NOT need to select anything in the right panel.

[ Reply to This | # ]