I’m trying to get information such as message id from the open windows in mail.app. I can’t figure it out. Here’s an example of what I want to do…
I have 3 windows open in mail, 1) a message viewer with the inbox selected, 2) a todo item, and 3) an email message. I can get the 3 windows using the following. But when I get the properties of one of the windows it tells me nothing about the actual content of the window. I can’t tell if the window is displaying the message viewer or a message. There’s no distinguishing property such as “kind” of window or “message id” of the window.
tell application "Mail"
set a to windows
properties of (item 1 of a)
end tell
There is a name property and the name corresponds to the subject of a message… but this doesn’t help because many messages could have the same subject. Any ideas about how to learn what kind of window something is?
FYI: I found this old post asking the same kind of question from 2003. There was no resolution for it though.
http://macscripter.net/viewtopic.php?id=5516