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

Re: Setting properties in Address Book


  • Subject: Re: Setting properties in Address Book
  • From: Christopher Nebel <email@hidden>
  • Date: Sun, 10 Feb 2008 21:25:16 -0800

On Feb 10, 2008, at 4:20 PM, Robert R. Horning wrote:

Thanks for the suggestion.  There is still a problem, as shown below.

On Feb 10, 2008, at 12:03 AM, Michelle Steiner wrote:

On Feb 9, 2008, at 10:26 PM, Robert R. Horning wrote:

In Tiger, having retrieved the person's id, is it possible to set properties, such as Title, Nickname, and Suffix, for a person in the Address Book after the entry for that person has been entered? If so, what's the syntax?


tell application "Address Book"
	set foo to person "Michelle steiner"

Unless I include the entire name exactly as it already exists in the Address Book, including any title, middle name, etc., the Script Editor returns:
"Address Book got an error: NSReceiverEvaluationScriptError: 4"

Assuming that you've obtained the Address Book id for a person (which I'd think would require you to find them by name somehow, but I'll assume you've solved that), then the syntax would be only slightly different from what Michelle gave you:


	tell application "Address Book"
		set foo to person id michellesid
		tell foo
			set its title to "Queen"
			-- etc.
		end
	end

In fact, you can see Address Book using this form itself. If you simply get a person -- not a property of that person -- Address Book will return a specifier giving that record by id:

	get person "Chris Nebel"
	--> person id "79DDA590-2412-4017-8B07-80FD912132FC:ABPerson"

Hopefully I answered the question you were trying to ask. If not, you'll have to clarify it.


--Chris Nebel AppleScript Engineering

_______________________________________________
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: 
 >Setting properties in Address Book (From: "Robert R. Horning" <email@hidden>)
 >Re: Setting properties in Address Book (From: Michelle Steiner <email@hidden>)
 >Re: Setting properties in Address Book (From: "Robert R. Horning" <email@hidden>)

  • Prev by Date: Re: a date is not a date? Or: Why I sometimes hate AppleScript...
  • Next by Date: Add Login item to the list
  • Previous by thread: Re: Setting properties in Address Book
  • Next by thread: Re: Setting properties in Address Book
  • Index(es):
    • Date
    • Thread