store all email attachments separately

Hello,

I have a lot of mails inside of DT and some of them have 1 or more attachments. I don’t want to touch the original mails, but I when I invoke the script, then it will store all attachments of all selected mails as separate items in DT.

Any idea?

best regards

I tried to write the script for this a few weeks ago but unfortunately the TextEdit engine in OS X does not give enough access to attachment of rich text documents (that’s how the text and the attachments of email messages are presented to a script). We get access to the attachment but TextEdit does not give us the path to the actual file I am afraid.

So it seems this would require some Cocoa magic, too, and not only pure AppleScript.

One idea: When the email messages reside in Apple Mail one can easily access the attachments using AppleScript.

So you could export the messages in question back to, say, a temporary mailbox in Apple Mail and work with them from there.