I am not yet running Sonoma, but I have someone who I wrote a script for update their machine to Sonoma and now the script isn’t doing what it should be doing. The script below should take the selected email messages, and move them to the Archive folder (as written this would be used with an iCloud inbox and the iCloud Archive folder. For whatever reason, Mail in Sonoma does not actually MOVE the message. The message will appear in the Archive folder after you have run this script, but as soon as you delete the message from the Inbox, it deletes the “copy” in the Archive maibox as well. This does not happen on Ventura.
tell application "Mail"
set archiveMailbox to mailbox "Archive" of account "iCloud"
set theMessages to selection
repeat with theMessage in theMessages
move theMessage to archiveMailbox
If you are running some version of Sonoma, do you see tis problem as well, where the message is not moved, and when you delete the version in the Inbox, the “copy” gets deleted from the Archive mailbox as well?
I have not yet tried to duplicate the message to the archive folder, and then delete the version in the inbox, and see if the Archive folder version also is deleted. That might be the workaround if this is indeed a bug with moving Mail messages in Sonoma.