tell application "Mail" tell message viewer 1 # ADDED
set selectedMessages to the selected messages
try
repeat with theMessage in selectedMessages
repeat with theAttachment in theMessage's mail attachments
get properties of theAttachment # ADDED
end repeat
end repeat
end try
end tell # ADDED
end tell
Here, the events log was:
tell application "Mail"
get selected messages of message viewer 1
--> {message id 134419 of mailbox "INBOX" of account "abcd", message id 134431 of mailbox "INBOX" of account "abcd"}
count every mail attachment of message id 134419 of mailbox "INBOX" of account "abcd"
--> 1
get properties of item 1 of every mail attachment of message id 134419 of mailbox "INBOX" of account "abcd"
--> {downloaded:true, MIME type:"image/png", name:"2014-10-17T19.08.01.png", file size:48268, class:mail attachment, id:"2"}
count every mail attachment of message id 134431 of mailbox "INBOX" of account "abcd"
--> 0
end tell
Yvan KOENIG (VALLAURIS, France) lundi 20 octobre 2014 16:32:59
The following line also does not work in Yosemite
repeat with theAttachment in theMessage's mail
It simply does not return any attachment so it won't enter the cycle. Has anybody opened a bug report to apple yet?