Please if anyone knows how to change unicode text or rich text format to plain text thru applescript would be appreciated. I know I have banged my head enough on one side… hate to see the other side of my head just as banged up…
I had the same issue and never came up with a “good” solution. I can find no way to coerce styled text into text. My eventual solution was to create a copy of the string one character at a time by converting each character to its ASCII equivalent and back again and appending it to the new string. That is the only way I found to remove the styling. (I will try to post code later tonight.)
If anyone has something better, please let me know.
tell application "Mail"
set myData to content of message X of mailbox "INBOX" of account "Me" as string
end tell
if class of myData is Unicode text then set myData to «class ktxt» of (myData as record)