Integrating MailTags, Mail Act-On & Toodledo

MailtagsToodledo

I recently started using indev’s awesome MailTags & Mail Act-On plugins for Mail.app. Just a couple of months before that, I also signed up for Toodledo – a really neat task management web app. As one can imagine, a lot of emails are really the source for most tasks that one manages. This is especially true in my area of work (project management).

Toodledo provides a mechanism for importing mail messages into it. The problem is, you need to remember a special syntax to enter in your subject line. More importantly, its additional work that you can do without. If you use Mailtags, you are already assigning contexts, projects, due dates, and priorities to your email. Why duplicate the effort? Macs are about making you more productive anyways.

So I hacked together an applescript that integrated MailTags & Toodledo. With Mail Act-On, a single keystroke allows me to send one or multiple messages tagged with MailTags straight to Toodledo. Add Growl to the equation for notification of success / failure, and you are all set!!

Features

  1. Sends a mail message with appropriate mailtags assigned directly to Toodledo.
  2. Puts a link to the message in the body of the task, so you can open the message directly within Toodledo (As long as you are visiting Toodledo on a Mac)
  3. Support for Context (Keywords), Folder (Project), Priority and Due Date as direct mappings.
  4. Support for other Toodledo fields through the Notes field in MailTags.
  5. Can act on multiple messages.
  6. Supports interactive mode – Edit the message before sending.
  7. If installed, notifies you of success through Growl.

My workflow:

  1. An email comes in Mail.app.
  2. I assign it a keyword (@followup, @Internet, @Work, etc) and a project. If required, a priority and a due date is also assigned. This is done using MailTags.
  3. Mail Act-On is configured to run an applescript (below) that duplicates this into a new message, modifies the subject to comply with Toodledo’s import syntax, and sends it out. My rule also archives the original message. Finally, a growl notification lets me know that its all done.
  4. Sometimes, I need to edit a message’s subject just before sending it. I have a variant of the above script that lets me modify it just before sending it.

Toodledo & MailTags Mapping

  1. Keywords in Mailtags – Context in Toodledo
  2. Project in Mailtags – Folder in Toodledo
  3. Due-date in Mailtags is the same in Toodledo
  4. Priorities:
    1. Very Low (Mailtags) = “-1. Negative” (Toodledo)
    2. Low (Mailtags) = “0. Low” (Toodledo)
    3. Normal (Mailtags) = “1. Medium” (Toodledo)
    4. High (Mailtags) = “2. High” (Toodledo)
    5. Urgent (Mailtags) = “3. Top” (Toodledo)

Limitations:

  1. The beauty of Toodledo & Mailtags is they can be used in different ways by different people. That, however, is a limitation of this script – I use “keywords” in MailTags as “contexts” in Toodledo. Also, you can only have one context, i.e., only one keyword assigned to a message in Mailtags for this script to work properly.
  2. Toodledo fields not supported directly – Goals, Tags, Start Date, Status, Length, and Due Time. MailTags doesn’t have these fields and hence its not possible. There is a work around however – If you need to add these, put them in the ‘Notes’ field in MailTags, in the special syntax that Toodledo understands. The script will take anything in the ‘Notes’ field of MailTags and assign it at the end of the subject, as is.
  3. While sending tasks via email, Toodledo does not support setting negative priority. So only tasks set with a Low Priority in MailTags will be set appropriately in Toodledo. You may still assign a ‘Very Low’ priority to a message; the script will simply ignore it.

Steps:

  1. You probably already have these, but for the sake of completeness, I must add – Install MailTags, Mail Act-On & sign up to Toodledo.
  2. Note the special email address created for you by Toodledo. Check under ‘Import/Export/Sync’.
  3. Ensure the projects in Mailtags match your folder entries in Toodledo
  4. Ensure keywords in Mailtags match exactly to context entries in Toodledo
  5. Copy the following two scripts in your scripts folder (~/Library/Scripts) as ‘Edit & Send to Toodledo.scpt’ and ‘Send to Toodledo.scpt’ respectively.
  6. Edit the top section of both these scripts in Script Editor and change the email address to your toodledo one (step 2).
  7. Create a couple of rules in Mail Act-On as shown. The first rule for ‘Archive’ message is optional and is just my workflow. Yours may be different.
  8. Tag your email as required. Here’s an example: Message tagged with mailtags
  9. Thats all! Just select the message. Call the Mail Act-On rule (appropriately for either sending directly, or editing before sending) with the keystroke you assigned and that should be it!.

The scripts

Disclaimer – I am a novice with applescripts. I used various applescripts on Mac OSX Hints, etc as reference to compile this one. My gratitude to all of the authors of these applescripts for making it available online. Please let me know of bugs, and I will try my best to address them with my limited knowledge of applescripts.

There are 2 scripts for each mail act-on rule. The first will open the message compose window, that will let you fine tune the message before sending (Tweak the subject line, add an attachment, etc). The second will let you send the message directly to toodledo. You’ll be notified by growl in this case.

Download Script 1 – Edit & Send to Toodledo (Interactive mode)

Download Script 2 – Send to Toodledo (Non-Intercative mode)

23 comments on “Integrating MailTags, Mail Act-On & Toodledo

  1. Pingback: Integrating MailTags, Mail Act-On & Toodledo Scripts Rss

  2. Pingback: Scripts to integrate Toodledo with mail.app and MailTags « Hawk Wings

  3. Great scripts, thanks! (I read about them on Hawk Wings blog.) One problem: When setting date via mailtags, it does not seem to work properly. Thanks.

  4. Hi Brian,

    Thanks for the feedback. When you say the date does not work properly, what exactly happens? Does it ignore it completely, or sets it incorrectly?

    Cheers.

  5. Hi, I’m not able to duplicate the date error but I noticed that when I try to set the priority to low or very low, the message created using Edit & Send to Toodledo does not place the email address in the To field and the Subject field is blank. And when using the Send to Toodledo script, nothing happens.

    Also, I notice that when I click in the Notes field of Toodledo, they Open in Mail link seems to disappear, or at least part of it. Odd.

    Otherwise, seems to work well. Many thanks!

  6. @Brian – Thanks for the added info. The priority issue was a bug. I think I have fixed it and uploaded a new version. Can you give it a try and let me know how you go?

    Do note that the Toodledo email syntax does not support ‘Very low’ priority (happy to be corrected). So setting it to very low priority in mail tags will treat it as being ‘low’ priority.

    Please let me know if there are any other issues.

    Cheers.

  7. Hi, The update to the script seems to have taken care of the priority bug. Thanks!

    The other issue I see relates to the Open in Mail link disappearing after clicking on it can be illustrated by these screenshots (look at in order for progression of view in Toodledo). Thanks.

    1) Looks fine:
    http://grab.by/FPX

    2) Clicking in note box you see the link:
    http://grab.by/FQ0

    3) Link disappears and rest of note looks like a link:
    http://grab.by/FQ1

    4) After clicking out of note box and trying to open it again, the note is gone, though you see a little space that indicates something was there:
    http://grab.by/FQ2

  8. Hi Brian,

    That is indeed strange. I tried it myself and can replicate the issue, but must admit that I am stumped! The scripts itself are good and put the right message in (as depicted in your image 1). This is even validated in the sent mail items.

    However, as soon as you edit the note on Toodledo, things start getting messed up. I could actually replicate the issue even with simple URLs… the note would still disappear!

    I might actually log it as an issue in Toodledo forums and see if I can get any hep there; but for the moment, the alternative may be to either get rid of the link or get rid of the message contents. Not sure which way to go..

    Cheers.

  9. Thanks. I did submit it as a bug to Toodledo and I’ll let you know about the response.

    BTW, you might want to update category “Toodledo & MailTags Mapping” to revise:

    Very Low (Mailtags) = “-1. Negative” (Toodledo)

    since very low defaults to low. Thanks.

  10. Really great – thanks! I’d like to add the attachments to the message, just can’t figure it out, any tips? ( I tried

    set attachments to mail attachments of thisMessage

    )

    Cheers!

    Angus

  11. Thanks so much for the great scripts. I googled a solution to use MailTags and Toodledo and one of the search results brought me to here.

    I’m not sure if this is related to the post #3, but I have a date problem. When I run Script 1, a due-date is inserted like “#August 1, 2010 ” and the result of an email to Toodledo is an undated todo. Help at Toodledo shows that a syntax for a specific due-date is something like “#5/12/08″. How do I change the script so that I can get “#1/8/10″ instead of “#August 1, 2010 ”?

    Thanks!

  12. @Angus – I do not believe that the email interface of Toodledo allows you to email attachments to it. It simply ignores any attachments. Thats my understanding anyways – happy to stand corrected.

  13. @Angus – I stand corrected. Apparently, Toodledo have a ‘Pro Plus’ version which /does/ support sending files as attachments via email. I do not have a Pro Plus account, but I doubt it requires anything fancy in the script. Just reading about it (http://www.toodledo.com/info/help_email.php) gives me the impression that Toodledo should simply assign any attachments to the task.

  14. @Kana – Thanks for the feedback.

    I am no expert at Applescript, but this might work:
    In the script, search for the line that reads:

    set {year:y, month:m, day:d} to thisMessage’s…
    set myduedate to ” #” & m & ” ” & d & “, ” & y

    Change it to read:

    set {year:z, month:n, day:d} to thisMessage’s…
    set m to n * 1
    set y to (text -2 thru -1 of (z as text))
    set myduedate to “#” & d & “/” & m & “/” & y

  15. Hi Himanshu,

    Thanks for the update. I tried changing the lines as you instructed, but unfortunately it didn’t work. So I went through some trial-and-error procedures and found out that the culprit was a space after the date at the end of the subject line. Without a space, both “#August 1, 2010″ and “#8/1/10″ worked just fine. Apologies for my confusion.

    Again, thanks a lot for the great scripts!

  16. Do you think there is a way through the script (and mail-tags maybe) to use the mail-tag note as new subject? Or to append something to the subject automatically?

    I am after a solution to have certain tasks STARRED in Toodledo.

    Thanks

  17. @MTokio – The scripts do use the Mailtags note field for any additional Toodledo syntax you may want to add in the subject line. Eg: A ‘*’ by itself in the Mailtags note field would have that task starred in Toodledo.

    At least that is how I wrote the scripts ;-) I will give it a try and confirm the behaviour

  18. Hi. I am new to toodledo and am attempting to follow your suggestions here. The image for how to configure Mail Act-On appears to be a bad link. Can you fix this so we can see the image? Thanks.

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>