Skip to content

Instantly share code, notes, and snippets.

@sttts
Last active December 24, 2015 06:19
Show Gist options
  • Save sttts/6756301 to your computer and use it in GitHub Desktop.
Save sttts/6756301 to your computer and use it in GitHub Desktop.
Using terminal-notifier the script shows persistent notification center messages for all flagged OmniFocus tasks. Possible, in the notification center preferences one needs to configure the OmniFocus message properly.
tell application id "OFOC"
tell default document
set today to current date
set lstTasks to flattened tasks where ((flagged is true and blocked is false) or (due date is not missing value and due date < today)) and completed is false
repeat with oTask in lstTasks
set theName to name of oTask
set theId to id of oTask
my notify(theName, "", "omnifocus:///task/" & theId, theId)
end repeat
end tell
end tell
on notify(theTitle, theDescription, theUrl, theId)
do shell script "/usr/bin/terminal-notifier -sender com.omnigroup.OmniFocus -title \"" & theTitle & "\" " & "-message \"" & theDescription & "\" -group \"" & theId & "\" -open \"" & theUrl & "\""
end notify
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment