• 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: Updating records in Address Book
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Updating records in Address Book


  • Subject: Re: Updating records in Address Book
  • From: Neil Faiman <email@hidden>
  • Date: Tue, 19 Feb 2008 07:17:57 -0500


On Feb 18, 2008, at 10:25 PM, Robert R.Horning wrote:

The following fails when I try to update an pre-existing person, returning the message "Can't set «class azf7» of \"F0E1BBE2-1F41-41F1-8AF9-4689222BE552:ABPerson\" to \"Bob\"."

tell application "Address Book" to set theCardID to id of person 2 -- different from item 2 of ABids, since there are pre-existing persons
tell application "Address Book" to set first name of theCardID to "Bob"
tell application "Address Book" to save addressbook

theCardId is not a person, it's an ID. Presumably (I haven't tried it), the syntax that you need is


	set first name of person id theCardId to "Bob"

But as Michelle already noted, if you know the person index, you can just use that directly. The only reason you would need to use the ID is that it is an immutable handle that will still be valid if you have done some intervening operation that might cause the person's index to have changed.

Regards,

	Neil Faiman
_______________________________________________
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: 
 >Updating records in Address Book (From: Robert R.Horning <email@hidden>)

  • Prev by Date: Re: Dynamically change button cell image within a table view
  • Next by Date: Re: Broken date math on AppleScript 2.0
  • Previous by thread: Re: Updating records in Address Book
  • Next by thread: Re: Stupid Newbie Question
  • Index(es):
    • Date
    • Thread