• 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: Scripting Apple addressbook
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Scripting Apple addressbook


  • Subject: Re: Scripting Apple addressbook
  • From: Christopher Stone <email@hidden>
  • Date: Thu, 10 Feb 2011 14:53:53 -0600

On Feb 10, 2011, at 12:24, Bob Cuilla wrote:
I am looking for some guidance in scripting  the address book
______________________________________________________________________

set printData to {}
set abGroupName to "Friends"

try
    tell application "Address Book"
        set {fName, lName, bDate} to {first name, last name, birth date} ¬
         of (people of group abGroupName whose birth date is not missing value)
    end tell

    

    set listLength to length of fName

    

    if listLength ≠ 0 then
        set AppleScript's text item delimiters to " "
        repeat with i from 1 to listLength
         set end of printData to ¬
         (get {fName's item i, (lName's item i) & ":", bDate's item i's short date string}) ¬
         as string
        end repeat

        

        set oldTIDS to AppleScript's text item delimiters
        set AppleScript's text item delimiters to return
        set printData to printData as text
        set AppleScript's text item delimiters to oldTIDS

        

        return printData

        

    else
        error "NO BIRTHDAYS FOUND!"
    end if
on error errMsg number errNum
    set sep to "=============================="
    set e to sep & return & "Error: " & errMsg & return & sep & return ¬
        & "Error Number: " & errNum & return & sep
    # beep
    # display dialog e
end try

 _______________________________________________
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: 
 >Scripting Apple addressbook (From: Bob Cuilla <email@hidden>)

  • Prev by Date: Re: Scripting Apple addressbook
  • Next by Date: Re: setting Eudora insertion point... HELP!
  • Previous by thread: Re: Scripting Apple addressbook
  • Next by thread: Options for file operations
  • Index(es):
    • Date
    • Thread