I accidentally sent this direct to Yvan instead of to the list.
On Jul 8, 2015, at 3:27 AM, Yvan KOENIG <
email@hidden> wrote:
How may we get the list of visible messages
I tried also :
tell application "Mail"
set frontViewer to (some message viewer whose index is 1)
log frontViewer --> (*message viewer id 8*)
properties of frontViewer
end tell
--> error "Erreur dans Mail : Le gestionnaire AppleEvent a échoué." number -10000
and got the same error message.
The problem seems to be with Visible Messages.
This works here on 10.10.3:
tell application "Mail"
get count of messages of first message viewer
end tell
If I change it to Visible Messages then I get the -10000 error
This also works:
tell application "Mail"
get count of (messages whose read status is true) of first message viewer
end tell
I actually don’t know what the visible messages is supposed to return, but it does not seem to work in any context. Is it supposed to give only the messages that can be seen in the message viewer or all of the messages that can be scrolled to?
If you want all of the messages that can be scrolled to then messages instead of visible messages should serve. I don’t know of any way to make a message in a viewer to be not visible.
Pat