Last active
October 24, 2016 15:58
-
-
Save EvanLovely/da4878cc8b1da47d1f73 to your computer and use it in GitHub Desktop.
Select items in OmniFocus, Run Script, and have [Sticky Notifications](http://instinctivecode.com/sticky-notifications/) Mac App put up notifications that are clickable back to OmniFocus task.
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
(* | |
OmniFocus to Sticky Notifications 2.0 | |
This script will take the selected tasks (or projects as well) in OmniFocus and create indiviual reminders in Sticky Notifications. Feel free to change the "title" part of the URL from "OmniFocus" to whatever you like. | |
Copyright 2012 -- [Brandon Pittman](http://brandonpittman.net) | |
Turn Omnifocus Tasks Into Sticky Notifications with AppleScript: | |
http://brandonpittman.net/2012/11/turn-omnifocus-tasks-into-sticky-notifications-with-applescript/ | |
(updates: works from OmniFocus toolbar; preserves prior text item delimiters; proper caps for OmniFocus :) -[dan](http://bylr.net/3/)) | |
(updates: 2014-05-30 Added clickable links in notification that takes you to OmniFocus task - From [Evan Lovely](http://evanlovely.com) [here](https://gist.github.com/EvanLovely/da4878cc8b1da47d1f73) | |
*) | |
tell application "OmniFocus" | |
set theWindow to front document window of front document | |
set theTasks to selected trees of content of theWindow | |
end tell | |
repeat with singleTask in theTasks | |
tell singleTask | |
set ti to name | |
set taskID to id | |
set taskLink to " omnifocus:///task/" & taskID | |
end tell | |
urlEncode(ti) | |
urlEncode(taskLink) | |
tell application "System Events" | |
open location "sticky-notifications://note?title=OmniFocus&message=" & ti & taskLink | |
end tell | |
end repeat | |
on urlEncode(str) | |
local str | |
try | |
return (do shell script "/bin/echo " & quoted form of str & ¬ | |
" | perl -MURI::Escape -lne 'print uri_escape($_)'") | |
on error eMsg number eNum | |
error "Can't urlEncode: " & eMsg number eNum | |
end try | |
end urlEncode |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
That's neat, but how I typically use the script is to complete the task when it creates the sticky notification.
StickyFocus