Last active
November 10, 2017 19:20
-
-
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
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
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