Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save simplicitybliss/8110304f39503ab836e1 to your computer and use it in GitHub Desktop.
Save simplicitybliss/8110304f39503ab836e1 to your computer and use it in GitHub Desktop.
Adds the page of the currently open tab in the frontmost Safari window to OmniFocus as an Inbox task with a review Context already set
(*
Written by Sven Fechner, @simplicitybliss http://simplicitybliss.com, Dec 2015
Adds the page of the currently open tab in the frontmost Safari window to OmniFocus
Requires you to define the context which should be set by default; Change the property below as required.
*)
property theReviewContext : "Read/Review"
tell application "Safari"
set theURL to (URL of current tab of window 1)
set theTitle to (name of current tab of window 1)
end tell
tell application "OmniFocus"
set theTask to "Read/Review \"" & theTitle & "\""
set theNote to theURL
tell default document
try
set theContextID to id of item 1 of (complete theReviewContext as context)
set theContext to first flattened context whose id is theContextID
on error
display alert "No context found whose name contains “" & theReviewContext & "”"
return
end try
make new inbox task with properties {name:theTask, note:theNote, context:theContext}
end tell
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment