On Feb 27, 2014, at 17:33, Terrazas, Enrique < email@hidden> wrote: Oops! Sorry, your code worked. I replied with the result from your code.
______________________________________________________________________
Hey Enrique,
Aha!
I didn't understand, because:
tell application "Mail" message viewer id 1 of application "Mail" end tell
Is also syntactically correct.
In general it's a good idea to indicate the result in some way to helps avoid misunderstandings.
--> The_Result
Or some such. I opened up 2 viewers, each with a different mailbox selected, and your code produces a result, but both produce exactly the same result no matter which viewer I select … odd.
They should not be the same...
tell application "Mail" some message viewer whose index is 1 end tell
# First message viewer:
--> message viewer id 1 of application "Mail"
# Second message viewer:
--> message viewer id 24 of application "Mail"
More detail:
tell application "Mail" set fMsgVwr to some message viewer whose index is 1 {name, it} of fMsgVwr end tell
# Pretty Print courtesy of Script Debugger:
# First message viewer:
{ "Today (3 messages)", message viewer id 1 of application "Mail" }
# Second message viewer:
{ "Yesterday", message viewer id 24 of application "Mail" }
We had a long discussion about this hackish method of getting the FMV, and we pretty much decided that somehow Mail was returning the message viewer whose window's index was 1.
That's very counterintuitive, and Apple should be ashamed of themselves for not providing window subclasses of Message-Views, Message, and Outgoing-Message.
In any case thanks for the input. :)
-- Take Care, Chris
|