Change email subject

Hi,

For archive purpose, I’d like to be able to “tag” the subject of emails (without using the tags, I would have hundreds of them). So I want to add some key words in the subject itself.

However I didn’t find a way to change the subject of an email. I moved recently on Mac, and I knew how to do that in Windows, but here I didn’t find a way.

This return a script error “Mail got an error: Can’t set subject of message”


tell application "Mail"
	set theMessage to item 1 of (the selection as list)
	set the subject of theMessage to my getNewSubject(subject of theMessage)
end tell

on getNewSubject(OldSubject)
	return text returned of (display dialog "Enter the new subject of the message and press Enter." default answer OldSubject)
end getNewSubject

Any Idea ?

Operating System: macOS 10.14

The dictionary ruling interaction between AppleScript and Mail is clear which states :

subject (text, r/o) : The subject of the message

r/o means read only.

We can’t edit this property.

Yvan KOENIG running High Sierra 10.13.6 in French (VALLAURIS, France) vendredi 22 mars 2019 09:35:45