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

Re: Showing a person in Address Book


  • Subject: Re: Showing a person in Address Book
  • From: "email@hidden" <email@hidden>
  • Date: Wed, 28 Jul 2010 21:45:44 -0700

Gideon, try this:

set myId to  "3ED8E6A0-5AF3-4BE5-8713-C4D82C9A7174:ABPerson"

tell application "Address Book"
set selection to my card
  set thePerson to first person whose id is myId
set selection to thePerson
end tell
tell application "Address Book" to activate


'my card' is a property of the application, and selecting it, makes "All Contacts" the active group. It does flash the wrong card for a second, so you may want to move the activate command to the end of the script.

HTH,

ESOn Jul 28, 2010, at 7:36pm, Gideon King wrote:

Hi all, I would like to show a person in the Address Book application. I know the ID of the person, and so far I can show Address Book with the person selected, but *only* if the person is in the group the user currently has selected in Address Book.

Here's my code:

tell application "Address Book" to activate
tell application "Address Book"
set thePerson to first person whose id is "3ED8E6A0-5AF3-4BE5-8713-C4D82C9A7174:ABPerson"
set selection to thePerson
end tell

How do I get Address Book to select the "All Contacts" group first, or switch to the card only view so that I am sure it will be able to show the person? Or is there another way to accomplish this?

Note: this is part of a commercial application, and as such I don't want to have to get people to turn on UI scripting, just to use this feature.

Thanks

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: Showing a person in Address Book
      • From: Gideon King <email@hidden>
References: 
 >Showing a person in Address Book (From: Gideon King <email@hidden>)

  • Prev by Date: Showing a person in Address Book
  • Next by Date: Re: Showing a person in Address Book
  • Previous by thread: Showing a person in Address Book
  • Next by thread: Re: Showing a person in Address Book
  • Index(es):
    • Date
    • Thread