It can¹t be done. Something like this should work:
every message of folder "Sent Items" whose address of address of every
recipient contains "string"
But it errors. Actually, I don¹t think you can use a whose clause on a whole
collection of elements (recipients) of every [element]¹ (message). But even
if you were content to specify just recipient 1, it still doesn¹t work. It
wasn¹t implemented for recipient¹ - in spite of script editors (Script
Debugger) that still tell you that whose clauses operate on message. (The
old Script Editor 1 pre-OS 10.3 would tell you by fulfilling a condition¹
but the new one doesn¹t.) Whose clauses don¹t come ³built in² - they have to
be implemented by the developers. Generally they work on properties of an
element, not elements of an element.
So
set msgs to every message of folder "Sent Items" whose subject contains
"string"
Will work.
For recipient address or display name filter, you¹re going to have to go on
using your repeat loop.
--
Paul Berkowitz
MVP MacOffice
Entourage FAQ Page: <http://www.entourage.mvps.org/faq/index.html>
AppleScripts for Entourage: <http://macscripter.net/scriptbuilders/>
PLEASE always state which version of Microsoft Office you are using - 2004,
X or 2001. It's often impossible to answer your questions otherwise.
From: Remo Del Bello <[EMAIL PROTECTED]>
Reply-To: "Entourage:mac Talk" <[email protected]>
Date: Wed, 29 Aug 2007 14:43:05 -0700
To: "Entourage:mac Talk" <[email protected]>
Subject: AppleScript: selecting messages with specified recipient
I'm trying to get and then export messages with a specific recipient from a
folder. I was hoping to use a "whose" clause to select the messages, but
can't seem to get the right syntax to look at the recipient address. Once I
have a message I can get use a repeat loop and:
get address of recipients of i
To get the address. I'd like one line to assign all affected messages to a
variable. Something like:
set msgs to messages of folder named sentItems whose recipients contains
"string"
I've tried:
whose recipients
whose to recipients
whose (address of to recipients)
whose (address of address of recipients whose recipient type is to
recipient)
(that last one seems ridiculous). In reality, I just want to export all
messages addressed to a display name containing "Fred".
Any pointers.
-Remo Del Bello
--
No sense being pessimistic. It wouldn't work anyway.