Anyone know how to use the Address Book palette from AS Studio?
I want to let my user pick an address book contact from the AB palette.
Anyone know how to use the Address Book palette from AS Studio?
I want to let my user pick an address book contact from the AB palette.
no one can even get me started on accessing the necessary Call Method commands for doing this?
i’m assuming this would be quite trivial for someone with any knowledge of OBJ-C and the Call Method Command.
Thanks for any help.
To use the ABPeoplePickerView, drag it from the ABPalette into your NIB. Then in Xcode, you need to include the AddressBook.framework (/System/Library/Frameworks/AddressBook.framework) in your linked frameworks (don’t copy the framework, just link it, and make sure to choose “Recursively…”) for this project. The ABPeoplePickerView contents are not scriptable (although you can script some properties of the view itself). For a great example of using this view from Obj-C (and thereby via call method in AS Studio), take a look at Apple’s demo ABPeoplePickerView project CocoaPeoplePicker:
http://developer.apple.com/samplecode/Sample_Code/Cocoa/CocoaPeoplePicker.htm
Jon
jon,
ok. i’m a bit lost here.
i added the framework, but the “Recursively…” radio button was greyed out. am i missing something?
how do i do this?
Double-click the ABPalette from the Finder (/Developer/Extras/Palettes/ABPalette.palette) to make it available in IB. Then you just drag the ABPeoplePickerView into your window just like you add any other control (button, popup, etc.). If you test the interface right then, that view will be populated with the Address Book contents and it will include the search field as well as the groups & people panes. In the attributes pane of the Info palette you can adjust some of the properties of the view including which fields to include (phone, address, etc.). When you drag the framework folder from the Finder and drop into the linked frameworks folder of your project in Xcode, you should get the dialog to copy the files in (don’t check the “Copy items” option and the “Recursively create groups for any added folders” option should be the default, I think).
The Apple documentation probably does a lot better job explaining this than I can:
Jon