Re: Getting text out of Mail headers
Re: Getting text out of Mail headers
- Subject: Re: Getting text out of Mail headers
- From: "@lbutlr via AppleScript-Users" <email@hidden>
- Date: Tue, 9 Jun 2020 19:31:05 -0600
(sorry for separate email, I forgot this list defaults to reply to sender and
not reply to list)
On 09 Jun 2020, at 18:22, Shane Stanley via AppleScript-Users
<email@hidden <mailto:email@hidden>>
wrote:
> On 10 Jun 2020, at 8:51 am, @lbutlr via AppleScript-Users
> <email@hidden> wrote:
>>
>> Ah, the answer is "poorly" 😃
>>
>> Header 1 returns the first matching header, header 2 the second matching
>> header. Every header returns, as one might expect, every matching header.
>
> So behaving exactly as AppleScript is supposed to is your idea of "poorly"?
Since there are an indefinite number of received headers, what is proper for
AppleScript is poor for dealing with mail received headers.
>> If there is a syntax for
>>
>> every header whose name is "received" and contains "ESMTPS id" and whose
>> text contains "by mail.myserver.tld"
>>
>> I haven't figured it out yet.
>
> Perhaps you should try a little harder.
Perhaps, but its not like it's obvious.espcially when you start with 'text' and
Script Editor changes it to rich text and the error is… well, as is often the
case, not actually helpful.
error "Mail got an error: Can’t make rich text into type specifier." number
-1700 from rich text to specifier
And then I got distracted with making a message URL.
> tell application id "com.apple.mail" -- Mail.app
> set theMessage to item 1 of (get selection)
> every header of theMessage whose name is "received" and content
> contains "by mail.myserver.tld" and content contains "ESMTPS id"
> end tell
Thanks.
--
Advance and attack! Attack and destroy! Destroy and rejoice!
_______________________________________________
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