• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Address Book ­ Get the current person's fax number
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Address Book – Get the current person's fax number (From: Le Pors Gilles <email@hidden>)

  • Prev by Date: Re: Removable Disks (wrapping code)
  • Next by Date: Weird dialog box...
  • Previous by thread: Address Book – Get the current person's fax number
  • Next by thread: Re: weird UI scripting problems
  • Index(es):
    • Date
    • Thread