I'll be Dead Soon! Select Text, Apply Font. Lion Mail. Should be Easy?

Hi,

Apols. in advance “ I’m being cheeky. I have started to wade through a huge ‘Teach yourself Applescript’ book I’ve bought to achieve something which I think should be really easy for someone who knows what they’re doing. At this rate it’ll take me about thirty years to get there!

I want to highlight some text in an Applemail message after I’ve composed it, and then have a script to apply a specific font and font size to that highlighted text. And that’s all. And I can’t figure out which chapter of the several hundred in the book is going to get me there.

Could one of you maybe help?

Kind regards,

David

Unfortunately, Mail knows about selected Mailboxes and selected Messages, but not selected text, so you’ve chosen a hard nut to crack.

Adam,

I guess just my luck that what I thought would be simple turns out to be difficult :frowning:

I had a look at Automator to see if I could create a service to apply a specific font to a text selection. However I can’t see any native way of doing this “ it can of course call an Applescript, which takes me right back to square one!

Thanks anyway, and if anyone else wants to chip in feel free. I can offer no more than eternal gratitude…

David

It gets worse, torchy – AppleScript is darned near useless for dealing with rich text. If all you want is to embolden the text that’s selected, Command-B will do that. There is also Copy Style and Paste Style though I’ll confess I’ve never used them. You don’t say what you want to do with the selected text so it’s hard to suggest a method, GUI or otherwise, that might get you there.

Hi Adam,

Here’s the problem I’m trying to solve. Almost all of my employer’s clients use Outlook. Internally my company uses Outlook and it appears that in Outlook, if you specify a particular font when composing an e-mail it ‘sticks’ and that’s what the Outlook recipient sees.

It would seem that Apple Mail doesn’t work this way, and it only ‘sets’ a font if the originally drafted text is changed before the message is sent. Otherwise it gets transmitted in such a way that it’s down to the recipient’s settings to determine output font.

My company has a font standard for e-mails. What this means is that when I use Apple Mail I have to compose the message, select it all, and then apply font. I was hoping to find some way around this manual exercise, or at least to script what I am manually doing.

It seems that this might be asking too much even though it sounded somewhat simple!

David

You can specify the default font (Preferences > Fonts & Colors > Message font) in Apple Mail
as well as rich text as the default message format (Preferences > Composing > Message Format).

both settings will be applied to every new outgoing message

Stefan,

That’s what you would have thought but that’s not the case. The settings apply that font to your won preview of the message whilst composing and subsequently viewing, but they only tag the message with a font if you actually apply a font to message text after it’s composed.

I know, stupid, but hours of testing with a Windows Outlook client have confirmed this.

David

I can’t even see where to highlight stuff in mail, but via a text edit rtf file it can be done. Create an rtf document, write some random text, highlight some of it then start to record an automator service doing whatever needs doing. If the highlighted text has to be in mail you can probably still get the same effect by some complicated (to me) text manipulation and copy-paste stuff.

What font are you trying to use?