nate of nine

Create Reminder Tasks from Email

For a while I’ve wanted to be able to add emails to whatever task manager I’m using, from any device I’m using. Currently I’m keeping things simple by using the default Reminders app for OSX and iOS, but this solution could work for any task management app that has an OSX counterpart and supports AppleScript.

I didn’t come up with this script entirely on my own, but I did customize it, alter the overall workflow, and work through some Gmail + Mavericks issues (now I’m starting to understand why Gmail’s IMAP bastardization is a real pain).

The process is pretty simple:

  1. Flag an email you want to have turned into a task
  2. Archive the email 1
  3. Go about your business

On my Mac mini I have running at home, I set up Reminders (already set up from my crazy Siri-controlled Blog Publishing post) and with my standard email accounts configured.

The key piece is the AppleScript that takes all flagged emails, creates a Reminders task out of them, and then un-flags them. Here it is:

That will check all enabled accounts. If you want to only process one account you’ll have to modify the script a bit. You can adjust what goes in the notes field as well if you want (msgBody). I opted to copy in the text of the entire email in case I needed to reference it while I was on the go. The link to the original email is at the bottom, but that only works on OSX. I also tried to keep the From text short (and stripped out the email address) so that the display in Reminders is more readable.

To get the AppleScript running periodically to check do this task you’ll need to set it up to run via launchd or cron. I’m more familiar with cron, but it seems as though Apple leaning towards launchd and adding additional functionalities. I figured this would be a good simple task to learn launchd on so I’ll have it in my toolbelt for later on.

What you need to do is create a new .plist file in ~/Library/LaunchAgents . Mine is named com.nateofnine.FlaggedEmailToReminders.plist  and looks like this:

Now all you need to do is log out and back in and this will start executing your AppleScript every 60 seconds!

  1. Gmail and IMAP caused some real issues in in Mavericks resulting in me being unable to properly archive the email via the AppleScript. The script pulls all flagged emails out of “All Mail”, so you can safely archive it out of your inbox knowing it will still be processed.