Last active
September 4, 2018 14:29
-
-
Save bertold/11994c9cd65b6fca79d59e294f96fa3f to your computer and use it in GitHub Desktop.
Deleting completed items from Reminders app on macOS
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
-- | |
-- This script will delete all completed items from the Reminders app | |
-- | |
tell application "Reminders" | |
-- retrieve the list of Reminder containers | |
set reminderLists to container of reminders | |
-- examine each Reminder container | |
repeat with currentList in reminderLists | |
-- retrieve the list of completed tasks | |
set completedItems to (reminders in currentList whose completed is true) | |
-- if found, then delete completed tasks | |
if (count of completedItems) > 0 then | |
repeat with completedItem from 1 to count of completedItems | |
delete item completedItem of completedItems | |
end repeat | |
end if | |
end repeat | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment