• 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
Parsing phone/emails in Address Book
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Parsing phone/emails in Address Book


  • Subject: Parsing phone/emails in Address Book
  • From: Darwin Zins <email@hidden>
  • Date: Fri, 7 Mar 2003 21:31:30 -0600

I am new to applescript and I was wondering if there is a
better/preferred/less verbose way to do this:

tell application "Address Book"
set peopleCount to the count of people
end tell

repeat with i from 1 to the peopleCount
tell application "Address Book"
tell person i

set a_phones to {}
set phoneRef to (a reference to a_phones)
set phoneCount to the count of phones
set existingPhones to (every phone)
repeat with j from 1 to the phoneCount
set currentItem to item j of existingPhones
copy value of currentItem to the end of phoneRef
end repeat

set a_emails to {}
set emailRef to (a reference to a_emails)
set emailCount to the count of emails
set existingEmails to (every email)
repeat with j from 1 to the emailCount
set currentItem to item j of existingEmails
copy value of currentItem to the end of emailRef
end repeat

Any comments or suggestions?

All I'm trying to do is copy the values of the phone numbers and email
addresses to a list, seems like a lot of code.

Thank you
_______________________________________________
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.

  • Follow-Ups:
    • Re: Parsing phone/emails in Address Book
      • From: Matthew Smith <email@hidden>
    • Re: Parsing phone/emails in Address Book
      • From: Andrew Oliver <email@hidden>
References: 
 >Re: applescript-users digest, Vol 3 #1424 - 11 msgs (From: admin <email@hidden>)

  • Prev by Date: Re: Move message to another mailbox behaves erratically?
  • Next by Date: Re: Searching for the equivalent of coercing to type "record"
  • Previous by thread: Re: applescript-users digest, Vol 3 #1424 - 11 msgs
  • Next by thread: Re: Parsing phone/emails in Address Book
  • Index(es):
    • Date
    • Thread