Does Applescript provide a mechanism for me to search for a message by subject; or do I have to write a loop and examine every message "by hand".
The code below generates this error:
Mail got an error: Can’t get subject of mailbox.
tell application "Reminders" set snoozeList to "Snooze" set notCompleted to reminders in list snoozeList whose completed is false set numNotCompleted to (count of notCompleted) repeat with index from 1 to numNotCompleted set reminderName to name of item index of notCompleted tell application "Mail" set theMailbox to mailbox "Snooze" of account "GVSU" set foundIt to (message in theMailbox whose subject is reminderName) display dialog read status of message foundIt end tell end repeat end tell
The error message suggests that
whose is being applied to the mailbox and not the messages; but, I can't figure out how to rephrase that line of code.
(For context, I would like to write a script that will iterate over all Reminders and move the linked email from the "Snoozed" folder back to the inbox. First, however, I have to figure out how to get a reference to the linked email.)