Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: Mail App - plain text
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Mail App - plain text



On Mar 30, 2011, at 12:50 PM, Dave Balderstone wrote:

tell application "Mail"
set default message format to plain text
set newMessage to make new outgoing message with properties {subject:"mailSubject", content:"mailContent" as text, visible:true}
set default message format to rich text
end tell

I'd save and restore the prefs slightly differently, especially if the script is running on someone else's Mac, but that may be a matter of preference:

tell application "Mail"
set oldFormat to default message format
set default message format to plain text
set newMessage to make new outgoing message with properties {subject:"mailSubject", content:"mailContent" as text, visible:true}
set default message format to oldFormat
end tell 

I had thought of that, but wrote it simply for the specific case presented.

Your first two lines could be reduced to this:

set {oldformat, default message format} to {default message format, plain text}

I don't know whether it would save anything, though.

-- Michelle

-- 
"Where is the wisdom we have lost in knowledge?
 Where is the knowledge we have lost in information?
 Where is the information we have lost in data?"

T.S. Eliot (1915)

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

References: 
 >Mail App - plain text (From: Steve Valenti <email@hidden>)
 >Re: Mail App - plain text (From: Michelle Steiner <email@hidden>)
 >Re: Mail App - plain text (From: Dave Balderstone <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.