Skip to content

Instantly share code, notes, and snippets.

@bertold
Last active September 4, 2018 14:29
Show Gist options
  • Save bertold/11994c9cd65b6fca79d59e294f96fa3f to your computer and use it in GitHub Desktop.
Save bertold/11994c9cd65b6fca79d59e294f96fa3f to your computer and use it in GitHub Desktop.
Deleting completed items from Reminders app on macOS
--
-- 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