Use MailMate Rules to Easily Create OmniFocus Tasks From Flags

Quickly Turn Flagged Emails into OmniFocus Inbox Items

If you’re a MailMate user and an OmniFocus user, I’ve got a hot tip for you. You can easily flag emails on your iPhone or iPad and have MailMate stick them in your OmniFocus your inbox. Here’s how:

  1. Modify MailMate’s “Add to OmniFocus” script to skip the quick entry tree.

    on run argv
        set theFilename to item 1 of argv
        set theName to do shell script "head -n1 " & theFilename
        set theNote to do shell script "tail -n+2 " & theFilename
    
        tell application "OmniFocus"
            tell default document
                --tell quick entry
                    set theTask to make new inbox task with properties {name:theName, note:theNote}
                    select {theTask}
                    set note of theTask to theNote
                    open
                    --tell application "System Events" to keystroke tab
                --end tell
            end tell
        end tell
    end run

  2. Set up a “Follow-Up” smart mailbox that watches for flagged emails.

  3. Set up rules on your “Follow-Up” mailbox to run your OmniFocus script and then remove the “Flagged” IMAP tag.

  4. Flag email on your iOS devices.

This approach means your flags will never stick around, but if you’re sticking to your “one inbox”, which is OmniFocus, it doesn’t really matter.

Revisiting SmartPerspective

CheckMark

I’ve finally done it! (I think…)

I wrote up a little script called SmartPerspective for OmniFocus that smartly opens up different perspectives depending on whether certain conditions have been met. If tasks in my “Daily” project (all the junk that needs to be done every day), it opens the “Daily” perspective. If that’s clear, it looks for flagged tasks in every context and if any exist, it opens “Flagged”. After that, if any available tasks are left, it opens “Next Actions”. Lastly, if none of these conditions have been met, it opens up the “Someday” perspective and then you can look at stuff that isn’t blocked (by a start date) but isn’t in an active project.

The first version of the script stupidly closed all windows and then created a new document window. This was awkward and slower than just resetting the perspective name property for the document window. Now, if a front document window is visible, it resets the perspective name property. If one isn’t visible, then a new document window is created. This is faster and smarter. Also, this approach finally seems to make using Keyboard Maestro’s application trigger “when OmniFocus activates” open the right perspective every time.

Check out the SmartPerspective Gist.

The Today Card/Journal File

I saw Patrick Rhone’s post about his Today Card and it reminded me that I may have never talked about my journal and accompanying AppleScript to file it in OmniFocus at the end of the day.

I keep a basic plain text journal in Dropbox and I open it up quickly using Keyboard Maestro.

Screen Shot 2013 08 16 at 10 42 41 AM

wkg="$HOME/Dropbox/Documents/Markdown"
journal="$wkg/Journal.md"
touch $journal;open -a "BBEdit" $journal

At the end of the day (I run a Launch Agent every day at 8pm to file my journal) I run this AppleScript to import my journal into OmniFocus.

set the_file to "Users:your_username:Dropbox:Documents:Markdown:Journal.md" as alias

open for access the_file
try
   set the_text to read the_file as «class utf8»
on error
   return "Journal empty."
end try
close access the_file

tell application "OmniFocus"
   tell front document
    make new inbox task with properties {name:"Journal for " & ¬
    date string of (current date), note:the_text, flagged:true}
   end tell
end tell

set eof of the_file to 0

Set the_file to wherever you keep your journal file, and then if the file has text in it, it will create the task in OmniFocus. If there’s no text in the file, it will error out and do nothing. Run this with launchd every day and you have an automatic way to dump your daily journal into your inbox.[1]


  1. I use as «class utf8» in order to properly read and write Japanese characters.  ↩

SmartPerspective for OmniFocus

Screen Shot 2013 08 15 at 3 47 56 PM

I have an order to the tasks I work on. If something’s flagged in OmniFocus, it should be done first. If there aren’t any flagged tasks, then I move on to regular next actions. If there aren’t any next actions, (which is rare) then I move on to “someday” tasks. This AppleScript checks if tasks fit those conditions, and shows you the proper perspective.

Check out SmartPerspective here.

If you want to take it a step further, run SmartPerspective with Keyboard Maestro and have it run anytime OmniFocus activates. If there’s no front window, nothing will happen. If there isn’t a front window, then the proper perspective will open up.

Update: 2013-09-14

I’ve finally done it! (I think…)

I wrote up a little script called SmartPerspective for OmniFocus that smartly opens up different perspectives depending on whether certain conditions have been met. If tasks in my “Daily” project (all the junk that needs to be done every day), it opens the “Daily” perspective. If that’s clear, it looks for flagged tasks in every context and if any exist, it opens “Flagged”. After that, if any available tasks are left, it opens “Next Actions”. Lastly, if none of these conditions have been met, it opens up the “Someday” perspective and then you can look at stuff that isn’t blocked (by a start date) but isn’t in an active project.

The first version of the script stupidly closed all windows and then created a new document window. This was awkward and slower than just resetting the perspective name property for the document window. Now, if a front document window is visible, it resets the perspective name property. If one isn’t visible, then a new document window is created. This is faster and smarter. Also, this approach finally seems to make using Keyboard Maestro’s application trigger “when OmniFocus activates” open the right perspective every time.

OmniFocus and Energy

Screen Shot 2013 01 21 at 11 31 37 AM

Omnifocus Needs An Energy Field

For me, the one thing missing from OmniFocus (as of 2013-01) is an energy field. You can give a task a start/end date, a context, a project, a time estimate and set it to be repeating, but you can’t set an energy level for it. One for the criteria David Allen suggests that you base priority of tasks on is energy. You can’t do something if you don’t have the tools for it. You can’t do something if you don’t have the time for it. And you can’t do something if you don’t have the energy for it. Don’t get all “You have to push yourself!” on me. Sometimes, you just don’t have the energy to do certain things. Writing a blog post is not really a low energy task. You have to be in the mood for it, or at the very least, be “up” for the task. On the other hand, things on my daily checklist includes flossing, taking a multivitamin and logging cash transactions in Koku. Those things aren’t mentally or physically taxing. Writing a blog post might be sometimes. Running a couple miles is. Those things are “high energy”.

Faking An Energy Field With Omnifocus 1.9

When OmniFocus 2.0 gets unveiled this month, it might have an energy field, but until then (and possibly even after), you can fake energy fields by adding “High Energy” and “Low Energy” as sub-contexts. I have contexts for “House” and “Mac” and each of those have high and low energy sub-contexts. Luckily, if you sort those tasks in OmniFocus, all of the “High Energy” tasks get lumped together, so it’s easy to quickly see which ones are high energy-only. Of course, you can also create perspectives based on these, and I do have a “Low Energy” perspective that I switch to when I’ve got time but I don’t have much energy to get stuff accomplished. Perspectives don’t update automatically, so if you create more energy sub-contexts later, be sure to update your energy perspectives accordingly.

Links – 2012-11-22

Plan your day better with OmniFocus time estimates

Assigning estimates forces you to clarify next actions. In cases where it was difficult to assign a time estimate, I realized I hadn’t clarified the next action well enough. Poorly defined next action → inaction.

Using estimates helps clarify what is feasible for the day. This morning, my first pass included almost 14 hours’ worth of work. Without time estimates, I wouldn’t have known how feasible this plan was.

You can start right now. No need to assign estimates to everything in your OmniFocus database; just estimate what you’re looking at for today.

I’m going to make an effort to plan time estimates into my morning reviews from now on.

Is Alcohol Good or Bad For Health?

A lot of obvious stuff here, but it’s nice reminder about things you should already be aware and mindful of.

Turn Omnifocus Tasks Into Sticky Notifications with AppleScript

Screen Shot 2012 11 18 at 12 24 07 PM

I’ve been playing with this script for a while, but I finally got it so it works with just AppleScript and doesn’t require Keyboard Maestro to work. It also will now create individual sticky notifications for each Omnifocus task.


Update! (2012-11-20) Dan Byler pointed out that the script didn’t run from Omnifocus’s toolbar and that I missed the “F” in OmniFocus. My TextExpander snippet had “f” as lowercase.


Update! (2013-02-05) I noticed that my basic search and replace for “space” and then “%20″ would screw up when tasks had quotation marks in the title, I updated the script with a proper Perl URL encode shell script so now, OF2SN should be bullet proof.

Download the script updated 2013-02-05 here.