Skip to content

Instantly share code, notes, and snippets.

@RichardHyde
Last active December 18, 2015 03:08
Show Gist options
  • Save RichardHyde/5715894 to your computer and use it in GitHub Desktop.
Save RichardHyde/5715894 to your computer and use it in GitHub Desktop.
Create OmniFocus items assigned to a context and project from a text file
tell application "OmniFocus"
tell front document
set theContext to first flattened context where its name = "Tesco"
set theProject to first flattened project where its name = "Groceries Shopping"
set txt to (read (POSIX file "/users/rjhyde/Dropbox/Documents/groceries.txt") as «class utf8»)
set gitems to every paragraph of txt
repeat with gitem in gitems
if (length of gitem) > 0 then
tell theProject to make new task with properties {name:gitem, context:theContext}
end if
end repeat
end tell
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment