Mail.app in Lion - is there a way to create tasks from email?

I'm not sure if I haven't seen that in earlier versions of Mail.app, but I would really love to have the ability to create a task in iCal from an email - and that this task could link to the original email.

Maybe there are some third-party solutions that would let this done easily?


Solution 1:

It's possible to do that with AppleScript.

If you're familiar with this technology, you should just browse iCal and Mail respective dictionary. If not, that's the occasion to become familiar ! This is a great place to start.

Here's a very basic script you could use (tested on Snow Leopard only, but should work fine on Lion as well) :

tell application "Mail"

    set theSelection to selection
    set theMessage to first item of theSelection
    set theSumm to subject of theMessage
    set theDescription to "From : " & sender of theMessage
    set theUrl to "message:%3C" & message id of theMessage & "%3E"

end tell

tell application "iCal"

    make todo at end of events of (first item of every calendar) with properties {summary:theSumm, description:theDescription, url:theUrl}

end tell

In order to use it easily in Mail, you should save it in ~/Library/Scripts/Applications/Mail/ (create folders if they don't exist) and activates the Scripts menubar item in preferences of AppleScript Editor. Here's the result when you're in Mail :

enter image description here

You can also use a productivity tool to launch your script. There are plenty of them out there but I personally use Keyboard Maestro & Alfred.

There's a lot of room for improvement. By example, you could set a default alarm, insert it in a given calendar… In order to improve it yourself, use the AppleScript dictionary : it's the best reference you could find. However, those links may be useful as well, as they provide many examples (some are maybe too old) : Scripting Mail & Scripting iCal.

Solution 2:

In Snow Leopard, I used the MailTag which is a Mail plugin, with the Mail.app. In MailTag, you are able to create a task which actually created in the iCal. However, MailTag released a new version for the Mail.app in Lion and temporarily removed this feature.

Since I am using the Things to manager the daily tasks, I usually just drag the mail message into the Things icon in the Dock and create an task there. Things will sync the tasks to iCal.

Solution 3:

There may be an even simpler solution, at least for my needs, using Automator. This solution takes selected text and uses it as the title of a new Reminder in a pre-set iCal calendar/to-do list.

I launched Automator and chose "Service" when it asked me what I wanted to create.

I left the initial settings at default ("Service receives selected [text] in [any application]")

From the Library pane on the left, I selected Calendar, and from the middle pane selected New To Do Item. I then selected Add to: [Existing calendar] and chose a calendar (my default Reminders calendar, which is on iCloud and syncs with my iPhone). Automator assumes (correctly) that you want to feed any selected text into the new To Do item. For my purposes, it made sense to set a default priority by ticking the checkbox and choosing Medium, but your needs may differ.

I saved the Service as CreateReminder (Automator automatically appended the extension .workflow). Voila, the service shows up in Mail.app when I select text, right-click on it, and select Services > CreateReminder.

As a bonus, this lets you create a reminder from selected text in in any application, not just in Mail.app.