Re: Parsing phone/emails in Address Book
Re: Parsing phone/emails in Address Book
- Subject: Re: Parsing phone/emails in Address Book
- From: Matthew Smith <email@hidden>
- Date: Sat, 08 Mar 2003 15:13:44 +1100
on 08/03/2003 14:31, Darwin Zins at email@hidden wrote:
>
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
Why not:
tell application "Address Book"
set peopleList to every person
repeat with onePerson in peopleList
set phoneList to value of every phone of onePerson
set emailLIst to value of every email of onePerson
-- now do something with each list
end repeat
end tell
--
Matthew Smith
_______________________________________________
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.