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

Search Contacts for phone number


  • Subject: Search Contacts for phone number
  • From: Bill Vlahos <email@hidden>
  • Date: Sun, 21 Sep 2014 14:33:11 -0700

How do I AppleScript a search of the Contacts application if I know the phone number? The application is a CallerID lookup so I just need to return the first name in the Mac Contacts application that has the phone number I’m searching for.

This script works to find every contact by name.
tell application "Contacts"
get name of first person whose name contains "Bill"
end tell

This script does NOT work to find every contact by phone number and results in the error below. What am I doing wrong?
tell application "Contacts"
get name of first person whose phone contains "805"
end tell

error "Contacts got an error: Can’t make phone into type specifier." number -1700 from phone to specifier

Thanks in advance,
Bill Vlahos
 _______________________________________________
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

  • Follow-Ups:
    • Re: Search Contacts for phone number
      • From: Axel Luttgens <email@hidden>
    • Re: Search Contacts for phone number
      • From: Christopher Stone <email@hidden>
    • Re: Search Contacts for phone number
      • From: Shane Stanley <email@hidden>
  • Prev by Date: Re: A permission problem?
  • Next by Date: Re: Can AppleScript determine if a shell process is running?
  • Previous by thread: Mail ; Compose and Paste Salutation String
  • Next by thread: Re: Search Contacts for phone number
  • Index(es):
    • Date
    • Thread