{"id":11275,"date":"2008-06-30T12:19:37","date_gmt":"2008-06-30T19:19:37","guid":{"rendered":"http:\/\/www.kith.org\/journals\/jed\/2008\/06\/30\/11275.html"},"modified":"2008-06-30T12:19:37","modified_gmt":"2008-06-30T19:19:37","slug":"autoresponder-for-mailapp","status":"publish","type":"post","link":"https:\/\/www.kith.org\/jed\/2008\/06\/30\/autoresponder-for-mailapp\/","title":{"rendered":"Autoresponder for Mail.app?"},"content":{"rendered":"\n<p>I need a way to automatically send responses to received email using Mail.app in OS X Leopard. Can any of you help me?<\/p>\n<p>Here's how I want it to work (with the difficult parts in italics):<\/p>\n<ol>\n<li>A new message arrives.<\/li>\n<li>A Rule recognizes the new message as one that should get an autoresponse. (This part is easy; no need to tell me how to do this.)<\/li>\n<li>Mail.app generates a response message, using boilerplate text, <em>but does not include the original message or attachments in the response<\/em>.<\/li>\n<li>Mail.app sends the response message <em>and leaves a copy of the sent message in a particular folder<\/em>.<\/li>\n<\/ol>\n<p>The standard approach to autoresponders in Mail.app is to set up a Rule that says \"Reply to Message\" and specifies message text. Unfortunately, that includes the full message plus all attachments in the reply, which I don't want. Also, it apparently makes the reply vanish, rather than putting it in the Sent folder.<\/p>\n<p>The AppleScript provided by \"<a href=\"http:\/\/email.about.com\/od\/macosxmailtips\/qt\/et022106.htm\">Set up a Non-Quoting Autoresponder in Mac OS X Mail<\/a>\" seems like it ought to do more or less exactly what I want, but I can't get it to work. I installed it, I set up a rule to call it; the rule gets triggered properly; but the script doesn't run. It sets off some kind of crash log in the Console, filled with stuff I don't understand.<\/p>\n<p>Also, Mac OS X Hints has an <a href=\"http:\/\/www.macosxhints.com\/article.php?story=20080314184621760\">article<\/a> that says that AppleScripts that generate a new Mail message won't run when called from a Rule in Leopard! They provide a wacky workaround in which the Rule calls a mini-AppleScript script that calls a shell script that calls the real AppleScript script. Horribly kludgy, but I'll live with it if I have to.<\/p>\n<p>But I'm pretty sure that some other problem is happening that's preventing me from even getting to that problem.<\/p>\n<p>As a test, I created the following script, put it in ~\/Library\/Scripts\/Applications\/Mail, and ran it from the Script-icon menu in Mail.app.<\/p>\n<pre>\nusing terms from application \"Mail\"\n\ton run\n\t\ttell application \"Mail\"\n\t\t\tdisplay dialog \"Hello, world!\"\n\t\tend tell\n\tend run\nend using terms from\n<\/pre>\n<p>That script works perfectly.<\/p>\n<p>But if I change \"on run\" to \"on perform mail action with messages\" and try to call it from a Rule, it dies. Here's that version:<\/p>\n<pre>\nusing terms from application \"Mail\"\n\ton perform mail action with messages theMessages for rule theRule\n\t\ttell application \"Mail\"\n\t\t\tdisplay dialog \"Hello, world!\"\n\t\tend tell\n\tend perform mail action with messages\nend using terms from\n<\/pre>\n<p>When I open the AppleScript Dictionary for Mail.app and look up \"perform mail action with messages\", it looks pretty straightforward--and it looks like it's the right way (maybe the only way) to get a message or messages to operate on. But something sure isn't working.<\/p>\n<p>Any ideas? I need to figure out <em>some<\/em> kind of answer by 9:00 p.m. California time tonight.<\/p>\n<p>If all else fails, I may switch to sending an autoresponse when I enter stories into the database, rather than when the mail arrives. It'll take longer for the responses to go out (sometimes a couple of days), but at least that way authors can be certain that the story has actually made it into our database. We'll see.<\/p>\n\n","protected":false},"excerpt":{"rendered":"<p>I need a way to automatically send responses to received email using Mail.app in OS X Leopard. Can any of&#8230;<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[24],"tags":[],"class_list":["post-11275","post","type-post","status-publish","format-standard","hentry","category-software"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.kith.org\/jed\/wp-json\/wp\/v2\/posts\/11275","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kith.org\/jed\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kith.org\/jed\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kith.org\/jed\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kith.org\/jed\/wp-json\/wp\/v2\/comments?post=11275"}],"version-history":[{"count":0,"href":"https:\/\/www.kith.org\/jed\/wp-json\/wp\/v2\/posts\/11275\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.kith.org\/jed\/wp-json\/wp\/v2\/media?parent=11275"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kith.org\/jed\/wp-json\/wp\/v2\/categories?post=11275"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kith.org\/jed\/wp-json\/wp\/v2\/tags?post=11275"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}