Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

API for accessing UI elements in Mac OS X

We are developing an application which helps people with reading disabilities. The user can let the application read out loud any text on the screen (menus, button labels, window titles, etc.) by hovering the mouse cursor over it (I know many OS’s can do this already, but this is a pedagogical tool and we are doing some additional stuff). We have a working application for Windows and now we would like to do something similar in OS X. Basically we want to implement something similar to the VoiceOver feature of OS X. My question is if there is an API we can use to access UI elements in OS X (like the Microsoft Active Accessibility for Windows). I have been reading about the Mac OS X Accessibility, but that seems more like an API to enable accessibility in your own app, not to access elements from the OS (or other apps). Am I wrong here?

like image 420
pajevic Avatar asked Jul 26 '11 20:07

pajevic


2 Answers

Accessibility will allow you to access other apps' UI elements as well. Check out the UIElementInspector sample code on Apple's site. It is very close to what you want to do.

like image 182
Chuck Avatar answered Oct 17 '22 00:10

Chuck


Yes, it's called the Accessibility API. It's very well documented here:

https://developer.apple.com/library/mac/documentation/Accessibility/Conceptual/AccessibilityMacOSX/

http://developer.apple.com/library/mac/#documentation/Accessibility/Reference/AccessibilityLowlevel/

like image 25
Ken Aspeslagh Avatar answered Oct 16 '22 23:10

Ken Aspeslagh