On 11/11/01 7:35 PM, "Bryan Harris" <[EMAIL PROTECTED]> wrote:

> 
> 
> Would someone mind trying this?
> 
> 1.  Open a new draft message window in 'rage (2001, OS 9.2.1)
> 2.  Run the following script:
> 
> tell application "Microsoft Entourage"
>   set selection to display name of contact id 5
> end tell
> 
> 
> 
> "get display name of contact id 5" works fine, and "set selection to "dog""
> works fine, but this crashes my 'rage with a type 2 every time.  Is it just
> my copy, or does anyone else see this too?
> 
> - Bryan
> 

Yes.

Try

tell application "Microsoft Entourage"
    set selection to (get display name of contact id 5)
end tell


or 

tell application "Microsoft Entourage"
    set dName to display name of contact id 5
    set selection to dName
end tell


This is quite common in Entourage and many other apps: you often need the
explicit 'get' or use a variable for a applying a property within a command.
But it should just error ("Microsoft Entourage or an error: could not make
some data into the expected type"), not crash, when it's not happy.

(It's true that 'contact' is a special implementation of 'address', so I
guess that's why 'display name' works. But you should normally use the
application property 'name', rather than 'display name' of contact. If you
look under 'application' in the Standard Suite, you'll see that the element
'contact' can be identified 'by name'.)

BTW, your test won't work at all for people who no longer have a 'contact id
5' because it's been deleted. But 'contact 5' will work for everyone with
more than 4 contacts.)


-- 
Paul Berkowitz


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

Reply via email to