Created
April 11, 2022 00:58
-
-
Save logic2design/2ac43332a5c1c6aba1f120aa275434b5 to your computer and use it in GitHub Desktop.
This will list the completed Reminders and output it to a text file
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
############################################## | |
# Title: List Completed Reminders | |
############################################## | |
# Iain Dunn | |
# Logic2Design | |
# www.logic2design.com | |
# [email protected] | |
# Last update: 11 April 2022 | |
# Version: 1 | |
# Contributors and sources | |
# | |
############################################## | |
# Configuration | |
############################################## | |
############################################## | |
# Code | |
############################################## | |
tell application "Reminders" | |
set lName to name of every list | |
set dName to name of default list | |
end tell | |
tell me to activate | |
set lName to choose from list lName with prompt "Select Reminder List" default items {dName} without empty selection allowed | |
if lName is false then | |
return 1 | |
else | |
set lName to lName as string | |
end if | |
set RemindersList to lName as text | |
# list Completed Reminders | |
tell application "Reminders" | |
tell list RemindersList | |
set reminderCompleted to name of reminders whose completed is true | |
end tell | |
end tell | |
# create String | |
set theBody to list2string(reminderCompleted, " | |
") | |
#Display option | |
display dialog theBody | |
#Clipboard option | |
set the clipboard to theBody | |
# Text File Option | |
set myFile to open for access (choose file name) with write permission | |
write theBody to myFile | |
close access myFile | |
############################################## | |
# Functions | |
############################################### Select Reminders List | |
#Function | |
on list2string(theList, theDelimiter) | |
set theBackup to AppleScript's text item delimiters | |
set AppleScript's text item delimiters to theDelimiter | |
set theString to theList as string | |
set AppleScript's text item delimiters to theBackup | |
return theString | |
end list2string |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment