On 11/17/00 7:53 AM, "George Clark" <[EMAIL PROTECTED]> wrote:
> Well, actually, since the ultimate goal is a script for Entourage, hopefully
> this won't be considered too far OT.
>
> Is there some way in AppleScript to make use of a textual version of a
> property to get that property? For example, say I have a list of properties
> for a contact that includes "first name", "last name", etc, but they're text
> (i.e., strings). Is there a way to make use of them to get the associated
> value (i.e., "get first name of x")?
>
set propList to {"first name", "last name", "company"}
set resultList to {}
repeat with i from 1 to (count propList)
set theProp to item i of propList
set theContact to "contact id 119" -- or "contact \"Paul Berkowitz\""
tell application "Microsoft Entourage"
set theResult to run script ("get " & theProp & " of " & theContact)
set end of resultList to theResult
end tell
end repeat
resultList
--{"Paul", "Berkowitz", "University of California"}
>
> On a related note, is there a way to get a list of the available properties
> for a contact? I think I can do this with any of several osaxen that read
> resources, but I'd prefer to avoid that if possible. These can be hard-coded
> in the Word dialog, but in the event that a new release of Entourage adds
> more properties, I'd like to be able to build the list dynamically.
I think that's the only way. 'properties of contact 1' doesn't get you a
properties list or record, it errors, do there's nowhere to start. You'll
just have to revise your script if Entourage revises the list of properties.
It won't happen all that often.
--
Paul Berkowitz
--
To unsubscribe: <mailto:[EMAIL PROTECTED]>
To search the archives:
<http://www.mail-archive.com/entourage-talk%40lists.boingo.com/>