Skip to content

Instantly share code, notes, and snippets.

@dgreen
Forked from cdzombak/Drop Action.scpt
Last active November 4, 2018 05:31
Show Gist options
  • Save dgreen/f723ed02d4c1d9c746cef22d2855538c to your computer and use it in GitHub Desktop.
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.
-- 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
@dgreen
Copy link
Author

dgreen commented Mar 6, 2018

Changed line 16 to use new (2.12, 3.0Beta) AppleScript verb with mark complete aTask instead set completed of aTask to true since the completed property has become read-only.

@dgreen
Copy link
Author

dgreen commented Oct 23, 2018

Update to OmniFocus 3 where there are tags instead of contexts

@dgreen
Copy link
Author

dgreen commented Nov 4, 2018

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