• 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: Creating a list of numbers from a Contacts group
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Creating a list of numbers from a Contacts group


  • Subject: Re: Creating a list of numbers from a Contacts group
  • From: Christopher Stone <email@hidden>
  • Date: Wed, 04 Jan 2017 20:48:49 -0600

On Dec 23, 2016, at 17:53, debt <email@hidden> wrote:
I want to create a list of all phone numbers that are in a Contacts group.


Hey Marc,

Here's how I'd go about doing this:

-------------------------------------------------------------------------------------------
tell application "Contacts"
   tell group "Family"
      set phoneNumList to value of every phone of every person
   end tell

   

   # tell every group
   # set phoneNumList to value of every phone of every person
   # end tell

   

end tell

try

   

   phoneNumList / 0

   

on error e
   set phoneNumList to e
   set shCMD to "echo " & quoted form of phoneNumList & " | tr '\"' '\\n' | sed -En '/[0-9]/p'"
   set phoneNumList to do shell script shCMD
   set AppleScript's text item delimiters to return
   set phoneNumList to text items of phoneNumList
end try
-------------------------------------------------------------------------------------------

It's faster than looping through things.

--
Best Regards,
Chris

 _______________________________________________
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: Creating a list of numbers from a Contacts group
      • From: debt <email@hidden>
  • Prev by Date: Re: 10.12.2 permission errors when saving
  • Next by Date: Re: AppleScript-Users Digest, Vol 13, Issue 525
  • Previous by thread: Re: 10.12.2 permission errors when saving
  • Next by thread: Re: Creating a list of numbers from a Contacts group
  • Index(es):
    • Date
    • Thread