Mac Developer Library


Address Book C Framework Reference for Mac Address Book Actions Reference

Address Book Actions Reference

The Address Book action callbacks allow you to populate the rollover menus of the Address Book application with custom items. You do this by writing an Address Book action plug-in that implements a function named ABActionRegisterCallbacks. This function registers a set of callback functions that are invoked by Address Book. The plug-in’s CFBundle must also implement the callback functions.

This is an example implementation of the ABActionRegisterCallbacks function:

  1. ABActionCallbacks* ABActionRegisterCallbacks(void)
  2. {
  3. ABActionCallbacks *callbacks;
  4. callbacks = malloc(sizeof(ABActionCallbacks));
  5. if (callbacks == NULL)
  6. return NULL;
  7. callbacks->version = 0;
  8. callbacks->property = actionProperty;
  9. callbacks->title = actionTitle;
  10. callbacks->enabled = actionEnabled;
  11. callbacks->selected = actionSelected;
  12. return callbacks;
  13. }

Each action plug-in can implement only one action. Actions can only apply to items with labels.

Use Xcode to create Address Book action plug-ins. Place action plug-ins in ~/Library/Address Book Plug-Ins or /Library/Address Book Plug-Ins, depending on the scope you want for the action.


Data Types