I’ve written a few times about OmniFocus, my task manager of choice.  One of the things I love about it is that you can expand its impressive toolset with Applescript, which comes built-in to every Mac.  You can drag and drop your scripts into ~/Library/Scripts/Applications/OmniFocus and OmniFocus will even make them into handy buttons that you can put on your toolbar.

For example, in my medical school rotations, I am frequently assigned tasks that I have to accomplish a certain number of times.  To keep track of my progress, what I’ve previously done is the following.

  1. Create a task and give it a descriptive name
  2. Duplicate the task however many times I need to do it
  3. Append a number to each
  4. Group the tasks (edit -> outlining -> group)
  5. Set the group to “sequential” instead of parallel

If I were assigned to do 10 History and Physicals by the end of a rotation, my resulting tasks might look something like this.

  • History and Physical 1
  • History and Physical 2
  • History and Physical 3

Since I set them to sequential, OmniFocus will automatically hide all the unavailable ones so that only the “next” one shows up in my active perspective (assuming I have the filter set to “available”).  This makes it as simple as can be to see that I need to work on “History and Physical 7” without crowding my active tasks with 8-10.  Without the numbering, I’d only see “History and Physical” tasks without the number to remind me how far along I am, how many more are left (I suppose I could number them 7 / 10 or something).

I use this workflow of creating numbered tasks often enough that I decided to try to write a little script for it.  10 tasks isn’t so bad to do manually, but this seemed easy to automate.  Perhaps I’ll use it more often now for tasks that may need to be done 100s of times.

I don’t know a whole lot of Applescript, so please forgive me if this is horribly written, but it seems to work.  It simply prompts for a task name, how many times the task needs to be done, and has the option to include a task note, since I often include hyperlinks in tasks that have to be done online (like virtual cases).  The tasks are simply placed in the inbox, since I find it just as fast to “select all” and use the inspector or drag-and-drop to group, assign projects, contexts, time estimates, etc.  Suggestions for improvement are much appreciated.  Please leave them in the comments section below.

Download this Applescript

on run {}
set counter to 0
set theTask to text returned of (display dialog "This script will duplicate a task a given number of times and number the tasks accordingly." default answer "Please enter the name of the task.")
set repeatTimes to text returned of (display dialog "How many total times do you need to do this task?" default answer "Please enter a number with no text and no punctuation.") as integer
on error
display dialog "Whups, I don't think that worked.  Try an integer next time."
end try
set taskNote to text returned of (display dialog "If you'd like the task to have a note, enter it below." default answer "") as string
tell application "OmniFocus"
tell document 1
repeat repeatTimes times
set counter to counter + 1
set taskName to {(theTask as string) & " " & (counter as string)} Probably could add " / " & repeatTimes or something like that to show out of how many times total
set newTask to make new inbox task with properties {name:taskName, note:taskNote}
end repeat
end tell
end tell
end run

Feel free to use and modify.  If you do, I appreciate links back to my blog / original posts.  Hope some of you find this useful!