Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Mac OS X > Quick way to attach print-to-pdf to an email?

Quick way to attach print-to-pdf to an email?
Thread Tools
Mac Enthusiast
Join Date: Jun 2000
Location: New York, NY
Status: Offline
Reply With Quote
Aug 19, 2003, 03:59 AM
 
Nine times out of ten I print to pdf so that I can attach it to an email. Is there a quicker way to do this then manually saving the file to the desktop, then switching to mail, then attaching the file?
     
Professional Poster
Join Date: Oct 2001
Location: London
Status: Offline
Reply With Quote
Aug 19, 2003, 04:35 AM
 
Yes - 10.2.4 introduced the PDF workflow thang.

http://www.apple.com/applescript/print/

Make a folder at ~/Library/PDF Services/

then in that folder put the applescript:

http://developer.apple.com/documenta...section_5.html
You know it makes sense. ☼ ☼ ☼ Growl.
     
Mac Enthusiast
Join Date: Mar 2001
Status: Offline
Reply With Quote
Aug 19, 2003, 04:36 AM
 
     
Mac Enthusiast
Join Date: Mar 2001
Status: Offline
Reply With Quote
Aug 19, 2003, 04:39 AM
 
Beaten to the post by DL!
     
poulh  (op)
Mac Enthusiast
Join Date: Jun 2000
Location: New York, NY
Status: Offline
Reply With Quote
Aug 19, 2003, 02:46 PM
 
thanks everyone!

i'll try it tonight. just curious, where does the program put this temporary pdf that is being attached to the email? is it thrown away after i send the email?

i guess i can ask this same question about where iPhoto puts the picture after i click the email button?
     
poulh  (op)
Mac Enthusiast
Join Date: Jun 2000
Location: New York, NY
Status: Offline
Reply With Quote
Aug 19, 2003, 02:49 PM
 
could i make the folder in the main Library folder so that all users can use this?

Which user and what groups should own the folder /script?
     
Professional Poster
Join Date: Oct 2001
Location: London
Status: Offline
Reply With Quote
Aug 20, 2003, 05:48 AM
 
Originally posted by poulh:
could i make the folder in the main Library folder so that all users can use this?

Which user and what groups should own the folder /script?
Yes, you can put it in the local library - see the link at the top of the page to apple's page.

not sure about ownership - but it will probably work as long as it is readable by all.
You know it makes sense. ☼ ☼ ☼ Growl.
     
Senior User
Join Date: Mar 2002
Location: CT
Status: Offline
Reply With Quote
Aug 20, 2003, 08:26 AM
 
Originally posted by poulh:
thanks everyone!

i'll try it tonight. just curious, where does the program put this temporary pdf that is being attached to the email? is it thrown away after i send the email?
Not being an AppleScript guru the natural language of AppleScript makes it rather easy to read. Seems that the script creates a folder and puts the PDF in it and then deletes the folder after creating the email. After running the script and naming the PDF something unique and then doing a search on my drive found nothing, so I guess it deletes it. I just wish the buttons it puts on the print panel weren't so damn huge.
     
Mac Elite
Join Date: Sep 2001
Location: Santa Monica, CA
Status: Offline
Reply With Quote
Aug 21, 2003, 01:45 AM
 
Originally posted by Chris Grande:
Not being an AppleScript guru the natural language of AppleScript makes it rather easy to read. Seems that the script creates a folder and puts the PDF in it and then deletes the folder after creating the email. After running the script and naming the PDF something unique and then doing a search on my drive found nothing, so I guess it deletes it. I just wish the buttons it puts on the print panel weren't so damn huge.
How do you give the PDF a unique name? When I print to a pdf to Mail, it is always listed as "print.pdf."

thanks
     
JKT
Professional Poster
Join Date: Jan 2002
Location: London, UK
Status: Offline
Reply With Quote
Aug 21, 2003, 06:57 AM
 
Originally posted by brachiator:
How do you give the PDF a unique name? When I print to a pdf to Mail, it is always listed as "print.pdf."

thanks
When this feature was first introudced, someone came up with a modified AppleScript that will ask you to name the file before it is added to the e-mail - hopefully you should just be able to copy paste this below into Script Editor and save it as a compiled script (put it in the /Library/PDF Services/ folder):

on open these_items
try
set this_file to item 1 of these_items
tell application "Finder"
set the file_name to the name of this_file
set the parent_folder to (the container of this_file) as alias
end tell
tell application (path to frontmost application as string)
repeat
display dialog "Enter a name for file:" default answer file_name
set this_name to the text returned of the result
if this_name is not "" then
if this_name does not end with ".pdf" then
set this_name to this_name & ".pdf"
end if
exit repeat
end if
end repeat
end tell
tell application "Finder"
set the name of this_file to this_name
set the target_file to ¬
(document file this_name of the parent_folder) as alias
end tell
tell application "Mail"
set the new_message to ¬
(make new outgoing message with properties ¬
{visible:true, content:" "})
tell the new_message
tell content
make new attachment with properties ¬
{file name:target_file} at ¬
before the first character
end tell
end tell
end tell
on error error_message number error_number
if the error_number is not -128 then
tell application (path to frontmost application as string)
display dialog error_message buttons {"OK"} default button 1
end tell
else
tell application "Finder" to delete parent_folder
end if
end try
end open
     
Grizzled Veteran
Join Date: Jan 2002
Location: Melbourne, Australia
Status: Offline
Reply With Quote
Aug 21, 2003, 09:17 AM
 
Originally posted by brachiator:
How do you give the PDF a unique name? When I print to a pdf to Mail, it is always listed as "print.pdf."

thanks
FWIF this page: http://www.apple.com/applescript/print/ mentioned earlier contains an AppleScript to e-mail the PDF that also prompts for a file name.
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 08:20 AM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2