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


Click here to return to the 'Printing to any printer from Classic' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Printing to any printer from Classic
Authored by: mm2270 on Oct 12, '04 01:02:37PM

Thank you! Thank you! THANK YOU!

This simple script solves a problem I've been working on at my job. We have a workflow with our separator where they send us .ps files of images they scan and we needed them to print to an HP color printer set up on our network here unattended and automtically. We've been attempting to write a script to hand off the PS file to the printer with no luck. After looking at your script I realized we were approaching it from a much more difficult place than necessary. I never realized that a simple "open with Print Setup Utility" would do it.

FYI- actually didn't need to convert to PDF first, a simple folder action opening the files with Print Setup Utility set to a default printer seems to do the trick! Fabulous!

Now I just need to figure out how to make it print 3 copies of each image.

Thanks again!



[ Reply to This | # ]
Printing to any printer from Classic
Authored by: strunx on Oct 13, '04 08:29:01AM

Anybody aware of a way to do this with .plt HPGL plotfiles?
Currently I drive my HP DesignJet 2500CP with Ethernet only interface by sending raw files via Folder Actions Script using lpr -l <filename> in Terminal. Not too elegant.
Printer Setup Utility should be capable of handling plt files, since they pop up there, once sent from terminal.
I tried to alter both scripts mentioned unsuccessfully...



[ Reply to This | # ]
Printing to any printer from Classic
Authored by: strunx on Oct 13, '04 08:57:48AM

OK, this seems to work:

on adding folder items to PrintFolder after receiving FilesToPrint
-- FilesToPrint will contain a list of file references to the added items
repeat with TheFile in FilesToPrint
set FileInfo to info for TheFile
tell application "System Events" to set FilePath to POSIX path of TheFile
do shell script "lpr -l " & FilePath
repeat while (busy status of (info for TheFile))
delay 1
end repeat
tell application "Finder" to delete TheFile
end repeat
end adding folder items to

I use a MIO internal 10/100 printserver and have the plotter setup in Print Center as default using either HP or GimpPrint provided ppd's.

I guess this could be helpful for folks with missing DesignJet drivers as well. Just set up the Printer using IPP and its IP adress.



[ Reply to This | # ]
Printing to any printer from Classic
Authored by: father2a-f on Oct 18, '04 01:55:57PM
Now I just need to figure out how to make it print 3 copies of each image.
Try setting Copies: to 3 in the Classic app's print dialog and then click the Save Settings button at the lower left corner. It will keep that copies settings until you change it and re-save. I tested it right now and it printed 3 copies of an item through a legacy app and the default OS X printer using the following folder action script:

on adding folder items to this_folder after receiving added_items
        repeat with each_item in added_items
                tell application "Printer Setup Utility" to open each_item
                delay 5
                tell application "Finder" to delete each_item
        end repeat
end adding folder items to
I had the Finder delete the file so that it would clean up after itself. Also, thank you and Dave Howell for this hint. I've been looking for just a solution.

[ Reply to This | # ]
Printing to any printer from Classic
Authored by: snarke on Oct 28, '04 05:25:01PM
You're welcome. :) I posted it when I happened to trip across this hint and thought "I'm doing it a different way that's not so Unix-y. I guess there are some other people who might want to hear about it."

Note that you can also print from an OS9-only computer this way. You have to AppleShare the print folder on an OSX-machine. So you save the .ps/.pdf file across the network to the Folder Action'ed folder on the OSX computer, and off you go.

Finally, the reason I have the .ps to .pdf code is that when I first wrote the script, I was running Jaguar, sharing my DeskJet, and unaware of the GIMP printing drivers, and a .ps file wouldn't print. I couldn't test to see if it was still necessary because not only am I running Panther now, but I also have GhostScript installed and a lot of other non-standard stuff (for the TeX typesetting system, in this case), and what worked for me might not work for other people. I found a reference somewhere that Jaguar had "pstopdf," and I figured better safe than sorry.

[ Reply to This | # ]