• 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: debt <email@hidden>
  • Date: Thu, 05 Jan 2017 10:00:45 -0800

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
end tell


Wow, Chris, that’s nice!  Short and sweet.  And if it’s faster than looping, that’s even better. :)

However, I can’t figure out the following section.

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


Are you forcing a division by zero to cause an error?  If so, what is the benefit of that over just grabbing the list and iterating over it?

What is shCMD trying to do?  I’m more familiar with Perl than with sed.

Also, set phoneNumList to e gives me the following error:

Can’t make {{"2125551212", "2347771556"}, {"(360) 740-8587", "8889992222"}} into type real.

Thanks,
Marc
 _______________________________________________
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: Steve Mills <email@hidden>
    • Re: Creating a list of numbers from a Contacts group
      • From: Yvan KOENIG <email@hidden>
References: 
 >Re: Creating a list of numbers from a Contacts group (From: Christopher Stone <email@hidden>)

  • Prev by Date: Re: Creating a list of numbers from a Contacts group
  • Next by Date: Re: Creating a list of numbers from a Contacts group
  • Previous by thread: Re: Creating a list of numbers from a Contacts group
  • Next by thread: Re: Creating a list of numbers from a Contacts group
  • Index(es):
    • Date
    • Thread