Skip to content

Instantly share code, notes, and snippets.

@ImSingee
Created August 26, 2019 11:11
Show Gist options
  • Save ImSingee/c9cb0196fea9ded17b6ce81586ca7956 to your computer and use it in GitHub Desktop.
Save ImSingee/c9cb0196fea9ded17b6ce81586ca7956 to your computer and use it in GitHub Desktop.
OmniFocus-清除截止时间,将选中的项目/动作的截止时间删除
on run {}
set i to 1
repeat with _action in my selectedActions()
my processAction(_action, i)
set i to i + 1
end repeat
tell application "OmniFocus"
tell default document
compact
end tell
end tell
end run
on selectedActions()
tell application "OmniFocus"
return my filterValues(my selectedValues(), {inbox task, task, available task, remaining task})
end tell
end selectedActions
on selectedValues()
tell application "OmniFocus"
return value of selected trees of content of first document window of front document
end tell
end selectedValues
on filterValues(_values, _classes)
tell application "OmniFocus"
set _result to {}
repeat with _value in _values
if _classes contains _value's class then
copy _value to end of _result
end if
end repeat
return _result
end tell
end filterValues
on processAction(_action, i)
tell application "OmniFocus"
set _action's due date to missing value
end tell
end processAction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment