On 7/23/02 8:05 PM, "Peter Wait" <[EMAIL PROTECTED]> wrote:

> I received this Script from Paul; I'll paste a copy of the script I executed
> here:
> 
> tell application "Microsoft Entourage"
>   set nbsp to every contact whose spouse � ""
>   repeat with i from 1 to (count nbsp)
>       set c to item i of nbsp
>       tell c to set its custom field one to its spouse
>   end repeat
> end tell
> 
> I then tested it in AppleScript, and it ran fine. So I moved it to the
> Entourage Script folder. I then selected it from the Script menu and
> executed it. The hard drive made the sound it makes when its doing
> something, and then this stopped. So it seemed to execute. But when I look
> at my data, none of my Custom One Fields contain the spouse; they are all
> still blank as they were.

Sorry, Peter, it wasn't you it was me, trying to be too succinct. Most
properties in Entourage need to be evaluated first by setting a variable to
them, or using the explicit 'get', if they're them going to be used further.
This line:

    tell c to set its custom field one to its spouse

didn't do that : i either need to

    tell c
        set theSpouse to its spouse
        set custom field one to theSpouse
    end tell

or 
    set theSpouse to c's spouse
    set c's custom field one to theSpouse

or, in one line:

    tell c to set its custom field one to (get its spouse)

This will work:


tell application "Microsoft Entourage"
    set nbsp to every contact whose spouse � ""
    repeat with i from 1 to (count nbsp)
        set c to item i of nbsp
        set n to name of c
        tell c to set its custom field one to (get its spouse)
    end repeat
end tell


-- 
Paul Berkowitz


--
To unsubscribe:                     <mailto:[EMAIL PROTECTED]>
archives:       <http://www.mail-archive.com/entourage-talk%40lists.letterrip.com/>
old-archive:       <http://www.mail-archive.com/entourage-talk%40lists.boingo.com/>

Reply via email to