Last active
December 18, 2015 03:08
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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