• 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: Search Contacts for phone number
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Re: Search Contacts for phone number (From: Paul Berkowitz <email@hidden>)

  • Prev by Date: Re: Search Contacts for phone number
  • Next by Date: Re: Can AppleScript determine if a shell process is running?
  • Previous by thread: Re: Search Contacts for phone number
  • Next by thread: Re: Search Contacts for phone number
  • Index(es):
    • Date
    • Thread