Re: Address Book Get the current person's fax number
Re: Address Book Get the current person's fax number
- Subject: Re: Address Book Get the current person's fax number
- From: Paul Berkowitz <email@hidden>
- Date: Tue, 11 Nov 2003 18:43:56 -0800
On 11/11/03 2:08 PM, "Le Pors Gilles" <email@hidden> wrote:
>
I'm trying to get the current person's fax number and the best I can
>
come up with, so far, is this:
>
>
tell application "Address Book"
>
set CurrentPerson to the first item of (get the selection)
>
set ThePhones to the phones of CurrentPerson
>
repeat with ThisPhone in ThePhones
>
if label of ThisPhone is "work fax" then
>
set TheFax to value of ThisPhone
>
end if
>
end repeat
>
display dialog (TheFax)
>
end tell
>
>
It works but it seems very convoluted.
>
>
Is there a better way?
set CurrentPerson to the first item of (get the selection)
try
set theFax to value of first phone of CurrentPerson whose label is
"work fax"
on error
set theFax to "" -- or whatever
end try
It may not have a work fax so you need a try block. You can do whatever you
think fit 'on error'.
--
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.