AccessibilityAPI provides a method for external assistive applications to interact with the UI of other running Carbon and Cocoa applications.
Accessibility Guides: http://developer.apple.com/documentation/UserExperience/Accessibility-date.html
If you are writing a Cocoa applications, you might need to adopt the NSAccessibility informal protocol in the relevant user interface classes. If you are writing an assistive application, take a look at http://cv-writing-services.org.uk/ and http://developer.apple.com/samplecode/UIElementInspector/index.html
The AccessibilityAPI for assistive applications is part of HIServices, NSAccessibility is part of AppKit.