Hi there, my first post. I would like to use AppleScript (eventually in an Automator Service) to get the contents (the body) of an email message in Apple Mail to a variable for later use. This is super easy. However, I don’t want the complete message content, but only the newest part, i.e. I want to leave out all that older content which resides in the quote levels.
From a raw-source point of view, I’d like everything following e.g.
–Apple-Mail-20-869988521
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
charset=ISO-8859-1;
delsp=yes;
format=flowed
until the end of the message body, but leaving out every line that begins with “>”, signifying a quote.
I know this won’t work all the time, because some users have set their mail clients to not show previous messages as quotes, but for default message setups this should work fine.
The goal is use that text in the next step to grab its translation from GoogleTranslate. (I’ve already managed to set that up.)
I’m not sure if you need to actually go into the raw source, and I’d rather like to prevent that, because special characters are not really sexy in raw text, considering it will be input in GoogleTranslate, but if that’s the only way to do it, I’ll be fine with it. In this regard I tried around a little bit with fndUsing and cng, but got nowhere.
Any help would be highly appreciated. tyia.
PS (Edit): If it’s only possible via the raw source, the script should also contain a conversion into UTF-8 (if possible).
Model: MacBook Pro (mid-2010)
AppleScript: 2.5
Browser: Safari 601.4.4
Operating System: Mac OS X (10.10)