--
Paul Berkowitz
MVP Entourage
Entourage FAQ Page: http://www.entourage.mvps.org/toc.html
PLEASE always state which version of Entourage you are using - 2001 or X. It's often impossible to answer your questions otherwise.
From: Beth Rosengard <[EMAIL PROTECTED]>
Reply-To: "Entourage:mac Talk" <[EMAIL PROTECTED]>
Date: Sun, 02 Mar 2003 12:25:08 -0800
To: "Entourage:mac Talk" <[EMAIL PROTECTED]>
Subject: Re: Entourage Script for a Single Contact
Hi Peter,
I'm not a scripter so I have no idea what I'm talking about but, if this script is supposed to duplicate what Paul gave you, it differs in several ways – like "set theContact to item i ..." instead of "item 1" – and there are others.
Beth
On 3/2/03 12:16 PM, "Peter Wait" <[EMAIL PROTECTED]> wrote:
With the following script:
try
set theContact to item i of (get selection) -- this evaluates to the true content
if class of theContact is not contact then
error number -128
end if
on error
beep
display dialog "Address Book Contact must be kept open"
return
end try
I always get the error message. Any help it what dumb mistake I’ve made this time?
Peter
On 3/1/03 4:57 PM, "Peter Wait" <[EMAIL PROTECTED]> wrote:
Not automatically. But it's easy enough, because in order to open it you had to select it in the Address book or a Custom View. So you can get it from the selection, as long as you haven't, say, changed the main window to Mail in the meantime.
- Is there a way to trigger a script to execute just when a Contact is Saved?
And
If so, What do I set “theContact” to, in the following extract from my current script?
set contct to every contact
repeating thru all the contacts:
set “theContact” to item i of contct
Thanks in advance for any help.
try
set theContact to item 1 of (get selection)
if class of theContact is not contact then error number -128
on error
beep
display dialog "You must keep the Address Book (or Custom View) where you selected the contact still open in the main window just behind."
return
end try
--rest of script
It also works if you run it just after closing the contact window. Or you can do it this way, but only if you run it while the contact window is open:
set windowName to name of window 1
try
set theContact to contact windowName
on error
beep
display dialog "You first have to save the contact, and must keep its window open until you run the script."
return
end try
--rest of script
close window 1
