Created
December 28, 2015 09:36
-
-
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
This file contains 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
(* | |
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