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.
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.
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.