public

Launch OmniFocus. Create a project called "Recipes". Go to any recipe site in Safari. Run the script.

  • Download Gist
ingredient-list-to-omnifocus.applescript
AppleScript
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
tell application "Safari" to set recipetitle to name of front document
tell application "Safari" to set recipeurl to URL of front document
 
set ingredients to (do shell script "curl http://recipedistiller.com/recipe/classify/?recipeurl=" & recipeurl & " | textutil -convert txt -stdin -stdout | grep '.' | sed 's/ • DELETE //g' | sed '$d'")
 
set my text item delimiters to "VIEW RECIPE"
set ingredients to text item 2 of ingredients
set my text item delimiters to "©"
set ingredients to text item 1 of ingredients
 
set i to quoted form of ingredients
set clean to do shell script "echo " & i & "| grep '.'"
 
set l to paragraphs of clean
 
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:"Recipe: " & recipetitle, note:"From: <" & recipeurl & ">"}
repeat with v in l
set theproject to (first flattened task where its name = "Recipe: " & recipetitle)
tell theproject to make new task with properties {name:v}
end repeat
end tell

Edited February 10, 2013 to sccount for changes to Recipe Distiller's output.

Updated March 24, 2013, adds ability to pull recipe name with ingredients as an indented task group. Also deletes last blank task (but not first) when pulling in ingredient lists.

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.