applescript, mail and attachments


I have many, many emails that say “attached are the minutes from that crappy meeting I made you attend.” The email itself is useless to me, but the attached minutes (usually a Word document) are something I would like to keep (and pass along to my grand children as proof that people will sit through anything if they are getting paid to do it…).

I’m currently dragging the attachments out of email and into my inbox, but I’m beginning to wonder if there is a more elegant/awesome way to do it. Is it possible to use applescript to extract attachments from email messges?


You don’t need any applescripts to do this becuase Apple mail have already such a function for this.

Just select all mail with attachments in apple mail and then choose File -> Save attachments and there you go :smiley:
After this, just index or import this attachments in your database.

Or, save them directly to the global Inbox folder and they’ll be imported automatically.

Or, if Devonthink is as central to your workflow as it is to me, use Hazel to direct all documents saved to your Downloads folder to the Devonthink Inbox. You can exclude .DMG, .ZIP or any other file that you don’t want to land up in Devonthink.

That way, when you “Save All” your email attachments to the Downloads folder, Hazel then plucks them out and stuffs them automatically into Devonthink. Works for me.

Thanks for the tips everyone! The “save attachments” is a workable solution. My love for devonthink just went +1. :smiley: