AppleScript with Mail not working in Sierra

I have a simple AppleScript to mark sent mail as read in Apple Mail. I have been using it for sometime but it has stopped working and I’m wondering anything has changed with Sierra (am running the GM) that has caused it to malfunction. The script is:
tell application “Mail”
set the read status of messages of mailbox “Sent” of account “iCloud” to true
end tell

Any ideas would be helpful.

I’m puzzled because her - running the last version of 10.12 in french, your script behaves flawlessly.
383 messages in the named mailbox on the system used for tests.
383 times true when I ask for the read status of all of them.
As I am curious, I ran it to set read status to false and it worked too.
At last I ran it to set read status to true and happily it worked.

At least I learnt something.

When I ask Mail to return the name of mailboxes of account “iCloud” there is no one named “Sent” but one named “Sent Messages” so I am accustomed to use this name and was a bit surprised by your naming but you’re right, “Sent” is a valid name.

Yvan KOENIG running Sierra 10.12 in French (VALLAURIS, France) samedi 10 septembre 2016 20:46:02

You know what - that’s odd as it has always worked for me for years with Sent and I just changed it to Sent Messages and it is now working again! Something must have changed in the last beta (before the GM) as that was when it stopped working (at least in the English version!).