Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save mattpetters/bdcd1609b4dd439c779b8feff2bbca4d to your computer and use it in GitHub Desktop.
Save mattpetters/bdcd1609b4dd439c779b8feff2bbca4d to your computer and use it in GitHub Desktop.
Writes Due Soon & flagged to console, I use it for easy copy paste to trello
tell application "OmniFocus"
tell front document
-- Get the list of tasks
set theDueTasks to every flattened task where its completed = false and due date is greater than (current date) and due date is less than (current date) + (7 * days)
set theFlaggedTasks to every flattened task where its flagged = true and completed = false
set dueCount to count of theDueTasks
set flagCount to count of theFlaggedTasks
if theDueTasks is not equal to {} then
set reportText to "Due soon:
"
repeat with theItem in theDueTasks
set reportText to reportText & " " & name of theItem & "
"
end repeat
set reportText to reportText & " Flagged: " & "
"
repeat with theItem in theFlaggedTasks
set reportText to reportText & " " & name of theItem & "
"
end repeat
return reportText
end if
end tell -- end tell front document
end tell -- end tell application "OmniFocus"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment