Script to automate filing Follow-Up emails from MailButler

Hey Folks,
I recently starting using MailButler (https://www.mailbutler.io) with OmniFocus so I can keep track of all of the important items I’ve emailed/delegated to others but want to make sure they don’t slip through the cracks.

I’m just an HR guy, so this is a bit of superglue + rubber bands to get it working. Here’s what you need to do to get it going.

  1. This requires you to have OF2 for iOS running (I use it with Siri integration when I’m in the car and get ideas)

  2. You must set the Reminder List in MailButler to the same OmniFocus Reminder List you’re using on your iOS device.

  3. You’ll want to use similar steps for @joebuhlig’s Auto-Parser (I shamelessly borrowed/stole
    parts of his script as well as @amorris Update Inbox Action. Thanks gents.)

  4. If you have any ideas of how to make this better, please let me know.

    set theContextName to “waiting for”
    set theProjectName to “Waiting Emails”

    tell application “OmniFocus”
    tell front document

     	set theProject to first flattened project where name = theProjectName
     	log theProject -- For debugging
     	set theContext to first flattened context where its name = theContextName
     	log theContext -- For debugging
     	set theInbox to every inbox task
     	if theInbox is not equal to {} then
     		repeat with n from 1 to length of theInbox
     			set currentTask to item n of theInbox
     			set taskName to name of currentTask
     			if taskName starts with "Follow-Up:" then
     				set taskName to ((taskName) as string)
     				set newTask to taskName
     				set the context of the currentTask to theContext
     				set the assigned container of the currentTask to theProject
     				set theNewDefer to the due date of currentTask
     				set theNewDue to missing value
     				set the due date of currentTask to theNewDue
     				set the defer date of currentTask to theNewDefer
     			end if
     		end repeat
     	end if
     end tell
    

    end tell

1 Like

Thanks for the shoutout, @chriswidner. :)

Would you mind walking through how you use this? I’m struggling to see how using this in conjunction with Siri and Reminders plays into it.

Sure thing @joebuhlig . The way MailButler works is that it sets the email reminder on an Apple Reminders list of your choice. Since OmniFocus for OSX doesn’t integrate with Apple Reminders, I have to tell MailButler to send it to my OmniFocus reminders list that the iOS version integrates with.

What’s really happening is:

  1. MailButler places the reminder in the OmniFocus Reminders list on OSX
  2. OSX syncs the Reminder list with iOS
  3. OmniFocus for iOS syncs with the Reminders list for iOS and pulls the task in
  4. OmniFocus for iOS syncs the tasks with OmniFocus for OSX
  5. The script runs and files the task for follow-up

Siri doesn’t play a role in this. I just mentioned Siri because that’s the only real reason to integrate OF for iOS and Apple Reminders at this point outside of using this script.

It’s nowhere as clean as MailButler pushing straight to OmniFocus for OSX, but from a user perspective it’s pretty smooth. I’m definitely open to suggestions to make it cleaner.

1 Like