You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Mail AppleScript - Print Email?

Hi

I have seen this mentioned/asked for a number of times but haven't been able to find a solution. Does anyone know if there is an applescript available that will print an email out of Mail?

Thanks,
Regan

Apple 17" Laptop, Dual G5 Xserve, Mac OS X (10.5.5)

Posted on Dec 5, 2008 11:02 AM

Reply
1 reply

Dec 5, 2008 6:23 PM in response to reganyelcich

Something like this ...


tell application "Mail"
set msg to the first message of mailbox "INBOX" of account "Google Mail (imap)"
set theText to content of msg
set theFile to ((path to desktop) as string) & "mailmsg.txt"
set theFileID to open for access file theFile with write permission
write theText to theFileID
close access theFileID
end tell
tell application "TextEdit"
set theFile to ((path to desktop) as string) & "mailmsg.txt"
set newdoc to open (theFile as alias)
print newdoc without print dialog
close newdoc
end tell


Eric

Mail AppleScript - Print Email?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.