Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: TIFF to PDF conversion



Hi Nuke,

Here is a handler which is based on a script I got from this list. It works for TIFF, JPEG, PICT, GIF and I think RTF as well.

on convertToPDF(thePOSIXFilePath)
try
set terminalCommand to ""
set convertCommand to "/System/Library/Printers/Libraries/./convert "
if text item -4 of thePOSIXFilePath is "." then
set newFileName to (text items 1 thru -5 of thePOSIXFilePath & ".pdf") as string
else
set newFileName to thePOSIXFilePath & ".pdf"
end if
set terminalCommand to convertCommand & "-f " & "\"" & thePOSIXFilePath & "\"" & " -o " & "\"" & newFileName & "\"" & " -j \"application/pdf\"" & " ; rm " & quoted form of thePOSIXFilePath
do shell script terminalCommand
tell application "Finder" to update file (POSIX file newFileName)
end try
end convertToPDF



John Cochrane

_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-users/email@hidden
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.