Hi all,

as the question was asked on another thread and as I had a solution for my own workflow I thought I'd make a more or less "clean" version and share it.

Feel free to try it, comment on it and suggest additions/modifications.

What is it :
It's an Applescript that :
• extracts the key information from the currently selected Mail message(s)
• opens up a new task creation window in Doit.im
• fills the Task title, the Notes section, tag, context and project
• auto-saves it (this is an option)

The task title contains the sender/receiver of the mail message and the mail subject (can be adjusted within the Header section of the Applescript)
The task note contains the "text" version of the email body as well as a "hyperlink" back to the original mail message on the first line.


How to use it :
The most comfortable way is to assign a global hotkey to that script. There are quite a number of free and of course paid apps that allow that. Personally I use Alfred with the power pack extension. However, you may also have a look at BetterTouchTool.
In that case, just highlight the email(s) in Apple Mail and launch the script via the assigned Hotkey.

Another option would be to copy the script to your script library (../users/<your profile>/Library/Scripts) and afterwards activate the script menu everywhere from within the Applescript Editor Preferences. In that case you only need to select your email and then the script from within the Applescript menu.


Personalize it :
The first part of the script contains a certain number of properties that can be adjusted. They look like this :
ptyThisProperty: value
Those values may be adjusted according to your personal needs. They allow the following :
• Set default Tag/Context/Project
• Truncate the message body
• Set correspondent as Tag/Context/Project or add it to the task title
• Activate Auto-Save (with Auto-save on you can select multiple emails at the time and each will create a new task)
• ….


Some final remarks :
• If you have trouble with permissions, … you could try to open the script with the Applescript Editor, copy all of the script, paste it to a new empty script and then compile and save that newly created script.
• As mentioned above, this is a work in progress script I made for my personal needs, so it might not work for you (the way you'd like it to). Feel free to come back to this thread and ask for help.
• This script uses GUI Scripting to access and "control" the Doit.im app. This means that any future update of Doit.im might break things. If it does, let me know and I'll try to fix it. Hopefully, in the future, Doit.im app will support Applescript or an API will be available to replace this script by something more "professional".

Last but not least the link to download the script : http://bit.ly/18l6z1t

Bye,
Lutz