OS X Mail: Create HTML-formatted Auto-response With AppleScript and Rules

OS X Mail: Create HTML-formatted Auto-response With AppleScript and Rules

Do you respond to a lot of emails with the same or similar content?  You can use Apple’s Mail app to do this for you automatically with some AppleScript and email rules.  Hopefully, you already know about the privacy glitch associated with Apple’s Mail program and Spotlight and have disabled the indexing of your emails.  If not, do that now.  Then, follow the instructions below.

Write The AppleScript (Or Download And Modify It)

To have an auto-response email sent whenever you receive a certain message, you will need to create an AppleScript like the one below:

Just modify the quoted HTML.  If your HTML has any double quotes in it, they will need to be escaped by putting a backslash in front of them.  If you don’t do this, your script will error out.

Save the AppleScript in

/Users/<your user>/Library/Application Scripts/com.apple.mail/

This will make it available within the Mail app.

Attach The AppleScript To A Mail Filter

It will now be available from within the Apple Mail rules section.  Now, all you need to do is create a rule and then choose your AppleScript from the pull-down menu.  Open Preferences > Rules > Add Rule.

Create your filter however you want, and then on the last line choose to run an a script.  Select yours from the pull-down menu.  You are all set!

Now anytime a message arrives that matches your criteria, an auto-response email will get sent (you will see a progress bar on the bottom right so you know that it is working).