I am new to AppleScript and want to use a Mail rule to run an AppleScript that prints a pdf received as an attachment to an email. This is what I have got so far…
tell application “Mail”
set selectedMessages to |SelectedMessages| of info
repeat with eachMessage in selectedMessages
set thePDF to (mail attachment of eachMessage)
save thePDF as “:temp.pdf”
tell application "Finder" print thePDF delete thePDF end tell end repeat end tell
This doesn’t actually work but hopefully is heading in the right direction. I f anybody could give some help that would be much appreciated, I have ground to a halt.