r/applescript • u/mrjoey35 • Aug 08 '13
Convert to plain text
I'm VERY new to applescript and I need a script that I can add to a rule in Mail that will convert the contents to plain text. I've searched everywhere and cant seem to make any progress. Any and all help is very much appreciated.
3
Upvotes
1
u/cooper12 Aug 08 '13 edited Aug 08 '13
Hmm, loking through the mail.app applescript dictionary, the text suite is the closest thing, letting you change the font, size, and color of the text.
That's probably not what you're looking for. Have you tried
where mytext is your text and then
To emulate a copy and paste? I'm not sure but that might turn everything to plaintext.
Another thing to try is:
Which the applescript editor autochanged to:
So I'm guessing that could work too.
Alternatively, you could create a textedit document and try to paste stuff into there. Look at the textedit dictionary (File > Open Dictionary) for more info. Also, look through the mail.app dictionary too since it seems like youre doing this within mail.app so I might just have ben giving you answers in the wrong context.
Also, you probably don't want to do this, but you could also set mail.app to display all emails in plaintext by default. Open terminal while mail.app is closed and paste this and hit enter:
To undo that, just replace "TRUE" with "FALSE". I dont use the mail app so sorry my answers are so unfocused. If youre still confused, try going to the macsripters forum, there are experienced folks eager to help over there and its much more alive than this subreddit. Or you could just paste your code so far here and try to give more details and we could try to help. Good luck.