Re: (no subject)
Re: (no subject)
- Subject: Re: (no subject)
- From: Henri Lamiraux <email@hidden>
- Date: Sat, 26 Oct 2002 23:10:07 -0700
Address Book knows how to deal with an URL of the following format
addressbook://<unique id of a person>
and
addressbook://<unique id of a person>?edit
So to simply open address book with a person selected
ABPerson *selectedPerson = ....;
NSString *uniqueId = [selectedPerson uniqueId];
NSString *urlString = [NSString stringWithFormat:@"addressbook://%@",
uniqueId];
[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:urlString]];
If you want address book to be in edit mode add '?edit' at the end of
the URL
ABPerson *selectedPerson = ....;
NSString *uniqueId = [selectedPerson uniqueId];
NSString *urlString = [NSString
stringWithFormat:@"addressbook://%@?edit", uniqueId];
[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:urlString]];
Henri Lamiraux
Engineering Manager
Apple Computer, Inc.
On Saturday, October 26, 2002, at 10:46 PM, Sheehan Olver wrote:
>
I have an objective-c program (Address550,
>
http://www.tc.umn.edu/~olve0003/address550.html, source code
>
available) that works with the Address Book framework. I'm trying to
>
figure out how I can get double clicking on a contact in Address550s
>
list to open in Address Book.app. I thought I might be able to do this
>
using AppleScript Studio, by attaching a script to a button, but the
>
script failed to be called. Is this even possible from an Objective-C
>
Cocoa project? I added the frameworks used in a AppleScript Studio
>
project, but that didn't seem to help.
>
I guess my more important question is what is the best way to do
>
this? Would it be distributed objects? Does Address Book.app support
>
this, and if so, where would I found out how to work with Address
>
Book.app? Also, is it possible to run applescript from Objective-C, in
>
a similar fashion to the java-bridge? I assume so, as some cocoa
>
programs do have script menus.
>
>
Thanks,
>
Sheehan Olver
>
_______________________________________________
>
cocoa-dev mailing list | email@hidden
>
Help/Unsubscribe/Archives:
>
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
>
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
References: | |
| >(no subject) (From: Sheehan Olver <email@hidden>) |