Basic Assistance requested

So mail.app doesn’t allow for the creation of true Template emails, so I figured I’d get AppleScript to do the majority of the work for me. I’ve got everything working as I’d like except for one thing, I can’t make some text bold.

set theBody to "Dear " & theFName & “,” & return & return & “Welcome to WestSide! This email will help you get started using your computer and the applications WestSide Staffers use to complete their work.” & return & "First off is the physical computer that sits in front of you. Each WestSide computer is assigned to an individual person, excluding field technician workstations. Your logon name for your computer is " & theName & ". The initial password is " & theMacPass & “. It is suggested that this password is changed as soon as convenient. You can change this password by going to the Apple in the top left corner of your screen, selecting ‘System Preferences’ and then the ‘Accounts’ icon. Select the ‘Password’ tab and change your password to one that you won’t forget.” & return & return & theSignature

id like to make the variables theName & theMacPass bold in the resultant email. Do I set it up here, or when I define the variables, and what coding do I use?

Thanks,
dayhox

I know the text class in mail is basically the same as in text edit, but I’m not sure exactly how to do what you want. Someone here will know.

One trick I use is that when you bold a word in OSX, what you’re really doing is changing the font to a bold version.

so…

tell application “Mail”
set x to make new outgoing message
set content of x to “Hello World!”
set plain_font to font of word 2 of content of x
set font of word 2 of content of x to plain_font & “-Bold”
end tell

– in the event log you’ll see…

tell application “Mail”
make new outgoing message
outgoing message id 5205952
set content of outgoing message id 5205952 to “Hello World!”
get font of word 2 of content of outgoing message id 5205952
“Helvetica”
set font of word 2 of content of outgoing message id 5205952 to “Helvetica-Bold”
end tell

That’ll work!