Re: Search Contacts for phone number
Re: Search Contacts for phone number
- Subject: Re: Search Contacts for phone number
- From: Shane Stanley <email@hidden>
- Date: Mon, 22 Sep 2014 11:57:32 +1000
On 22 Sep 2014, at 11:41 am, Paul Berkowitz <email@hidden> wrote:
> Except even after finding the first of these, it will keep looping
After a return statement? I don't think so...
> Bill, I think you're going to have top be a bit more specific: can you really be certain that only one contact's phone number contains "805"?
For sure.
> set peopleList to {}
> tell application "Contacts"
> repeat with aPerson in people
> set theNumbers to value of aPerson's phones
> repeat with aNumber in theNumbers
> repeat with aNumber in theNumbers
> if aNumber contains "805" then
> set end of peopleList to aPerson's name
> exit repeat
> end if
> end repeat
> end repeat
> end repeat
> end tell
> return peopleList
I think you've doubled up your "repeat with aNumber in theNumbers" unnecessarily in there.
--
Shane Stanley <email@hidden>
<www.macosxautomation.com/applescript/apps/>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden