I’ve been trying to figure out a way to script import of messages from Mail and I am not getting anywhere with it. So, I thought that I should ask for help here.
There are 2 scripts that I am trying to combine results from. First is the “Copy selection to…” script from /User/Library/Scripts/Devonthink Pro and the second is “Mail Import” from DevonThink Pro’s script menu.
First script takes selected message, prompts for a group to import to, then imports as RTFD with attachments if there are any. Unfortunately, it also imports HTML mail as an attached HTML file instead of parsing and improrting as RTF. Another negative of this script is that if you have more then 1 message selected it imports all of them as one record.
Second Just imports all messages from the mailbox as TXT loosing any attachments. I finally found a modification to that script here in the forum where it will only import selected mailboxes instead of all mailboxes.
What I am trying to achive is the following:
- Prompt for a mailbox or a message to be selected. Also work with multiple mailboxes or messages selected and import them separately, not as one record.
- Prompt for a group to import to. Import messages in that group. Import Mailbox as a new group inside selected group with messages below new group.
- Import as RTF if no attachments parsing HTML mail and importing it as text not as file or RTFD if there are attachments.
I am a very-very-very begininer in Apple Scripting so I am asking for help. Does anyone have a script like that or is willing to help create one?
Very much appreciate any help I can get.
Thank you