THIS WEEK'S SPONSOR:

Concepts

Sketch, Note, Draw


Create OmniFocus Tasks From Drafts, Scratch, Or Any Text Editor Through Dropbox

Back in October 2010, I posted a tutorial on how to add new tasks to OmniFocus or Things using Dropbox, AppleScript, and PlainText by Hog Bay Software. In June 2011, I wrote about more ways to add tasks to OmniFocus (my GTD app of choice), and noted how I had only “scratched the surface of what’s possible to do with OmniFocus and task creation”.

I decided to slightly revisit my workflow now that several “quick Dropbox note-taking apps” like Scratch and Drafts have come out. These apps are already integrated in my daily routine, but the following method works with any text editor, and, obviously, using Dropbox is recommended if you want to be able to create tasks from anywhere.

The 2010 workflow relied on separate text notes to process the contents of a file, and turn it into an inbox task. Thanks to these new apps’ “append” functionality, we can now rely on a single text file (I called mine “OF.txt”) to convert every single line to a new task. The process is very simple, and apps like Drafts and Scratch can append text in seconds, making it extremely easy to capture anything in seconds, so you can come back to your Mac to find new tasks ready in OmniFocus.

In Drafts or Scratch, pick the text file you’re going to append text to. The advantage of this workflow is that, whereas OmniFocus for iOS is a fantastic app, adding new tasks to the inbox isn’t exactly quick, as you often have to wait for the app to refresh the sync database, which can be slow on 3G. I want to be able to capture ideas (that will later become tasks) with ease, and plain text delivers on this need.

On the Mac, you just need to monitor the OF.txt file for changes, and run an AppleScript to add lines of text as tasks to OmniFocus. You can do so by using Folder Actions Setup (as I detailed in October 2010), or, even better, Hazel. In case you missed our coverage, you have plenty of reasons to be using Hazel (see also: Hazel 3.0 on Mac Power Users Episode #79).

set p to POSIX path of "/Users/viticci/Dropbox/Apps/OF.txt"

set input_file to POSIX path of p

set l to paragraphs of (do shell script "grep . " & input_file)

do shell script ">" & input_file


tell application "OmniFocus" to tell document 1

	repeat with v in l

		make new inbox task with properties {name:v}

	end repeat

end tell

The script was created by Josh Betz, and it’s very simple. In the first line (make sure to be using the version he posted in the “Update” of his post), replace the path with your OF.txt file. For some reason, Hazel was throwing an error on the script for me, so I had to add an additional line as you can see in the screenshot above. Once processed, the contents of the text file will be cleared.

A simple and elegant solution to a common problem, this will allow you to enjoy the simplicity of plain text and speed of apps like Drafts and Scratch, while keeping track of your tasks using OmniFocus. As I mentioned above, you can use any text editor to add new lines to the text file (though auto-save might be tricky to deal with – you don’t want incomplete lines to be saved in OmniFocus), but I just like Drafts and Scratch better for this job.

You can find the script here, and you get the apps by following the links below.

- Drafts for iPhone - $1.99

- Drafts for iPad - $2.99

- Scratch - $2.99

Unlock More with Club MacStories

Founded in 2015, Club MacStories has delivered exclusive content every week for over six years.

In that time, members have enjoyed nearly 400 weekly and monthly newsletters packed with more of your favorite MacStories writing as well as Club-only podcasts, eBooks, discounts on apps, icons, and services. Join today, and you’ll get everything new that we publish every week, plus access to our entire archive of back issues and downloadable perks.

The Club expanded in 2021 with Club MacStories+ and Club Premier. Club MacStories+ members enjoy even more exclusive stories, a vibrant Discord community, a rotating roster of app discounts, and more. And, with Club Premier, you get everything we offer at every Club level plus an extended, ad-free version of our podcast AppStories that is delivered early each week in high-bitrate audio.

Choose the Club plan that’s right for you:

  • Club MacStories: Weekly and monthly newsletters via email and the web that are brimming with app collections, tips, automation workflows, longform writing, a Club-only podcast, periodic giveaways, and more;
  • Club MacStories+: Everything that Club MacStories offers, plus exclusive content like Federico’s Automation Academy and John’s Macintosh Desktop Experience, a powerful web app for searching and exploring over 6 years of content and creating custom RSS feeds of Club content, an active Discord community, and a rotating collection of discounts, and more;
  • Club Premier: Everything in from our other plans and AppStories+, an extended version of our flagship podcast that’s delivered early, ad-free, and in high-bitrate audio.