Skip to content

Instantly share code, notes, and snippets.

@antonio
Last active November 10, 2017 19:20
Show Gist options
  • Save antonio/993cefd768b5d6808870f76db1ffb980 to your computer and use it in GitHub Desktop.
Save antonio/993cefd768b5d6808870f76db1ffb980 to your computer and use it in GitHub Desktop.
Flag things that I need to do today and unflag things that I don't in Omnifocus
on run
tell application "OmniFocus"
set todayDate to current date
set todayDate's hours to 0
set todayDate's minutes to 0
set todayDate's seconds to 0
set tomorrowDate to todayDate + 1 * days
tell default document
set flaggedTasks to (flattened tasks where ((defer date < tomorrowDate or due date < tomorrowDate) and completed is not true))
repeat with t in flaggedTasks
set t's flagged to true
end repeat
set unflaggedTasks to (flattened tasks where (flagged is true and defer date >= tomorrowDate))
repeat with t in unflaggedTasks
set t's flagged to false
end repeat
end tell
end tell
end run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment