Does anyone know of a way to search Mail for a message when you only have the subject? I have found references on the forum to finding by messageID but I don’t have that.
Thanks
Dee
Model: MacBook Pro 17
AppleScript: XCode 2.4.1
Browser: Safari 419.3
Operating System: Mac OS X (10.4)
Hi deedeew
this may be of help
http://developer.apple.com/documentation/AppleScript/Conceptual/StudioBuildingApps/listing/chapter_14_section_1.html
if whereToFind is equal to "Subject" then
if whatToFind is in the subject of m then
copy m to end of messagesFound
end if
Budgie
Thanks for the response. It appears that I am missing something in this. My requirements are quite a bit simpler than the example. I just want to search all the mailboxes for the first subject that matches the requirement.
repeat with theMailbox in mailboxes
repeat with eachmessage in theMailbox
if "hello today" is in the subject of eachmessage then
set messID to id of eachmessage in theMailbox end if
end repeat
end repeat
open message messID
end tell
this does not result in finding and opening the message that I have placed in the inbox. Obviously, I haven’t done anything if the message is not found. I just wanted to see if it would find the message that I know is there.