Skip to content

Instantly share code, notes, and snippets.

@poritsky
Created November 13, 2012 01:53
Show Gist options
  • Save poritsky/4063426 to your computer and use it in GitHub Desktop.
Save poritsky/4063426 to your computer and use it in GitHub Desktop.
Serious Eats Ingredient Lists to OmniFocus
tell application "Safari" to set ingredientlist to text of front document
set my text item delimiters to "
Ingredients"
set ingredientlist to text item 2 of ingredientlist
set my text item delimiters to "
Procedures"
set ingredientlist to text item 1 of ingredientlist
set l to paragraphs of ingredientlist
tell application "OmniFocus" to tell document 1
repeat with v in l
set theproject to (first flattened project where its name = "Recipes")
tell theproject to make new task with properties {name:v}
end repeat
end tell
tell application "Safari"
set TaskName to name of current tab of window 1
set TaskNote to "From: " & URL of current tab of window 1
end tell
tell application "OmniFocus" to tell document 1
set theproject to (first flattened project where its name = "Recipes")
tell theproject to make new task with properties {name:TaskName, note:TaskNote}
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment