Re: Scripting Jag's Address Book
Re: Scripting Jag's Address Book
- Subject: Re: Scripting Jag's Address Book
- From: Paul Berkowitz <email@hidden>
- Date: Sun, 01 Sep 2002 12:54:43 -0700
On 9/1/02 11:32 AM, "Norman Cohen" <email@hidden> wrote:
>
New to this list but have been doing some limited AppleScripting for
>
years. Is there a way to use AppleScript to get the person entry data
>
for the record showing in Jag's new Address Book application? Looking
>
through the dictionary, I didn't see any reference within the
>
application, document or window class for the currently showing record.
There doesn't appear to be anyway to do this. There is nothing corresponding
to 'selection'. The dictionary does have a 'document' class which is
currently totally unused, so maybe one day you'll be able to refer to
'document 1' to mean 'currently displayed card' [hint to Apple]. For now,
the only thing UI can think of is a _very_ clunky workaround: tell the user
to drag the current card to the desktop and select it, then tell the Finder
to get the name of 'item 1 of (get selection)' and - if it corresponds to an
AB person- go ahead.
tell application "Finder"
try
set theThing to item 1 of (get selection)
set theName to name of theThing
set theExtension to name extension of theThing
if theExtension /= "vcf" then error number -128
on error
display dialog "You forgot to select the vCard."
return
end try
set dName to displayed name of theThing
end tell
tell application "Address Book"
try
set thePerson to person dName
on error -- some other vCard not yet imported!
display dialog "You forgot to make a vCard on your desktop and
select it."
return
end try
-- your other stuff
end tell
--When all's said and done, although Address Book is quite serviceable, it's
not got 1/50th of the features or scriptability of an app like Entourage
although I do really like the 'label' property, especially for phones.
--
Paul Berkowitz
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.