Mime-Version: |
1.0 (Apple Message framework v1084) |
Content-Type: |
text/plain; charset=us-ascii |
Date: |
Fri, 19 Aug 2011 17:05:27 -0400 |
Reply-To: |
|
Subject: |
|
From: |
|
In-Reply-To: |
<p06240806ca730937b676@[192.168.1.66]> |
Content-Transfer-Encoding: |
quoted-printable |
Sender: |
|
Parts/Attachments: |
|
|
On Aug 18, 2011, at 2:28 PM, John Delacour wrote:
> 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
Both approaches produce the same result, on a Snow Leopard machine and a Panther machine (Don't ask). It's something about the e-mail message, not the code.
>
>
>> 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?
That works -- in both code formats -- and will do what I need. Thanks.
Bill Steele
[log in to unmask]
|
|
|