Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to auto replay with attachment using applescript in mac mail?
    primarykey
    data
    text
    <p>I am trying to set up an auto reply in Mac Mail that includes an attachment. I can get the auto reply to work with the text message but not with the attachment. I am trying to use applescript but I'm not really that familiar with it. I've tried</p> <pre><code>tell application "Mail" set {theSender, theAddress, theSubject} to {extract name from sender, extract address from sender, subject} set theBody to "Hi - attached you will find out paper, Effects of experimental forest management on a terrestrial, woodland salamander in Missouri, which you requested. If you believe you received this email without solicitation please let me know at dhocking@unh.edu.I hope you find our paper useful! -Dan" set theAttachment to "Macintosh HD:Users:Dan:Documents:Papers2:Hocking:2013:Articles:Hocking_2013_Forest_Ecology_and_Management.pdf" as alias set MyReply to make new outgoing message with properties {recipient:theSender, subject:"Hello: " &amp; theSubject, content:theBody} make new attachment at MyReply with properties {file:_Attachment} --open MyReply --comment out if you dont need send MyReply --un comment this to auto send your mail end tell </code></pre> <p>and I have also tried</p> <pre><code>using terms from application "Mail" on perform mail action with messages theMessages for rule theRule repeat with eachMessage in theMessages tell application "Mail" set theAttachment to "Macintosh HD:Users:Dan:Documents:Papers2:Hocking:2013:Articles:Hocking_2013_Forest_Ecology_and_Management.pdf" tell eachMessage set {theSender, theAddress, theSubject} to {extract name from sender, extract address from sender, subject} end tell set newMessage to make new outgoing message with properties {subject:"Re: " &amp; theSubject, visible:true} tell newMessage make new to recipient at end of to recipients with properties {name:theSender, address:theAddress} tell content to make new attachment with properties {file name:theAttachment as alias} at after the last paragraph end tell activate send newMessage end tell end repeat end perform mail action with messages end using terms from </code></pre> <p>I'm sure I'm missing something simple but I've never used an applescript before, so clearly I'm missing something. Any help would be appreciated. I'm using Mail v6.2 on Mac OS 10.8.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload