-
-
Save dgreen/f723ed02d4c1d9c746cef22d2855538c to your computer and use it in GitHub Desktop.
OmniFocus AppleScript to move an action to my "❌ Dropped" context and mark it completed.
This file contains hidden or 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
-- Drop an action | |
-- Mark it "Complete" and add front tag of "❌ Dropped" | |
-- | |
tell application "OmniFocus" | |
tell front document | |
try | |
set droppedTag to first tag where its name contains "Dropped" | |
on error | |
display alert "No tag found whose name ends with “" & "Dropped”" | |
return | |
end try | |
tell content of document window 1 | |
set taskList to value of every selected tree | |
repeat with aTask in taskList | |
-- mark dropped, then mark complete, if it repeats remove droppedTag | |
add droppedTag to front of tags of aTask | |
mark complete aTask | |
-- When the task is marked complete and if it is a repeating task | |
-- the repeating task is copied and then marked complete (carrying the | |
-- dropped tag with it. The remaining task is moved to the next time | |
-- and the dropped tag should be removed from it | |
if repetition rule of aTask exists then | |
remove droppedTag from tags of aTask | |
end if | |
end repeat | |
end tell | |
end tell | |
end tell |
Update to OmniFocus 3 where there are tags instead of contexts
Added logic so that any repeated item (which is actually the original modified) does not have the drop tag.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Changed line 16 to use new (2.12, 3.0Beta) AppleScript verb with
mark complete aTask
insteadset completed of aTask to true
since the completed property has become read-only.