Re: Printing PDFs doesn't?
Re: Printing PDFs doesn't?
- Subject: Re: Printing PDFs doesn't?
- From: Joshua See <email@hidden>
- Date: Sat, 8 Jan 2005 13:52:43 -0600
On Jan 6, 2005, at 1:34 PM, Jeff Porten wrote:
Very simple script, hopefully a very simple problem. I have a list of Finder-returned PDF files. I want to repeat through them and print them.
tell application "Preview" to print eachpdf
pops up the document on screen for an instant and closes it, with no printing.
Why are you using Preview?
tell application "Printer Setup Utility" -- or Print Center under Jaguar
open "Macintosh HD:path:to:some.pdf" -- works with PS or PDF files
end tell
Since Printer setup Utility isn't a document based application, you use the open command rather than print. It will print to your default printer. You should even be able to throw a list of files at it rather than use a repeat loop. Panther might have widened the variety of files that PSU will take, but I haven't tested that.
The following lets you choose the printer, but requires Panther. Also, the printer must have been created with PSU, not through the CUPS web interface or CLI.
set printproxy to (choose file with prompt "Choose a printer:" default location ((path to library folder from user domain as string) & "Printers") without invisibles) as string
tell application printproxy
open "Macintosh HD:path:to:some.doc" -- works with any printable file, according to Mac Help
end tell
Spookily enough, when tested with a GIF graphic it didn't open the creator application to print it.
--
Sincerely,
Joshua See
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden