MACSCRPT Archives

August 2011

MACSCRPT@LISTSERV.DARTMOUTH.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
John Delacour <[log in to unmask]>
Reply To:
Macintosh Scripting Systems <[log in to unmask]>
Date:
Thu, 18 Aug 2011 19:28:05 +0100
Content-Type:
text/plain
Parts/Attachments:
text/plain (33 lines)
At 13:04 -0400 18/08/2011, Bill Steele wrote:


>Getting the text of an incoming message in Apple Mail is pretty 
>straightforward (albeit not intuitive):
>
>tell application "Mail"
>set mySel to selection
>set Msg to item 1 of mySel
>set msgText to content of Msg
>end tell
>
>(Why those lines won't combined escapes me)

Probably because you tried ...item 1 of selection..., which would 
have worked in the old days but not under the new order.


tell application "Mail"
	set _msg_body_as_text to content of item 1 of (get selection)
end tell


>Works fine most of the time, but every so often I hit a message 
>where the result is
>
>"?"

What do you get if you ask for 'source' rather than 'content', which 
gives you a plain text conversion of the message body?

JD

ATOM RSS1 RSS2