FROM : Evan Gross
DATE : Mon Mar 03 12:27:42 2008
On 28/02/08 8:27 PM, "Ryan Homer" <hzc.<email_removed>> wrote:
> I've read this post
> (http://lists.apple.com/archives/accessibility-dev/2006/Aug/msg00007.html
> ) about using the accessibility options to read the text under the
> cursor. However, this requires that the user enable access for
> assistive devices in System Preferences. The application must
> therefore check for that. It also seems quite complicated; I don't
> want to have to deal with glyphs and the like - I only want the text
> under the cursor, full stop.
>
> The Dictionary application is able to read a word under the cursor
> without enabling access for assistive devices.
>
> Does anyone therefore know of an alternative way to do this?
>
> Thanks in advance.
>
The Dictionary panel is a special kind of input method component:
/System/Library/Components/DictionaryService.component
It uses various techniques to obtain the text from the application (Text
Service Manager and TSM Document Access CarbonEvents, along with
Accessibility APIs).
If Accessibility is off, and your app isn't a trusted one, TSM (and
presumably the Leopard IMKit equivalents) is the only reliable way to get
the text at any screen location. Many apps support this, there are still
quite a few that don't. There are some that support one, but not the other.
Best to try TSM first, then if no luck try AX.
If you take a close look, the Dictionary panel will also try to get the font
and style information, and display the word(s) being defined with their
actual attributes. Again, some apps support this via TSM, AX, or even both,
the majority of apps don't. All the Mac OS X editing views (NSTextView,
MLTE/HITextView, editable WebKit views) support both - perhaps not
perfectly, but well enough.
If your requirements are that this must work anywhere, with any app, forget
it. Try to get the Dictionary popup to do anything in MS Word, for
example...
Hope that helps,
Evan Gross
--
Evan Gross, President, Rainmaker Research Inc.
Developers of Macintosh and Windows Software
Spell Catcher for Mac OS and Windows
http://www.rainmakerinc.com/
DATE : Mon Mar 03 12:27:42 2008
On 28/02/08 8:27 PM, "Ryan Homer" <hzc.<email_removed>> wrote:
> I've read this post
> (http://lists.apple.com/archives/accessibility-dev/2006/Aug/msg00007.html
> ) about using the accessibility options to read the text under the
> cursor. However, this requires that the user enable access for
> assistive devices in System Preferences. The application must
> therefore check for that. It also seems quite complicated; I don't
> want to have to deal with glyphs and the like - I only want the text
> under the cursor, full stop.
>
> The Dictionary application is able to read a word under the cursor
> without enabling access for assistive devices.
>
> Does anyone therefore know of an alternative way to do this?
>
> Thanks in advance.
>
The Dictionary panel is a special kind of input method component:
/System/Library/Components/DictionaryService.component
It uses various techniques to obtain the text from the application (Text
Service Manager and TSM Document Access CarbonEvents, along with
Accessibility APIs).
If Accessibility is off, and your app isn't a trusted one, TSM (and
presumably the Leopard IMKit equivalents) is the only reliable way to get
the text at any screen location. Many apps support this, there are still
quite a few that don't. There are some that support one, but not the other.
Best to try TSM first, then if no luck try AX.
If you take a close look, the Dictionary panel will also try to get the font
and style information, and display the word(s) being defined with their
actual attributes. Again, some apps support this via TSM, AX, or even both,
the majority of apps don't. All the Mac OS X editing views (NSTextView,
MLTE/HITextView, editable WebKit views) support both - perhaps not
perfectly, but well enough.
If your requirements are that this must work anywhere, with any app, forget
it. Try to get the Dictionary popup to do anything in MS Word, for
example...
Hope that helps,
Evan Gross
--
Evan Gross, President, Rainmaker Research Inc.
Developers of Macintosh and Windows Software
Spell Catcher for Mac OS and Windows
http://www.rainmakerinc.com/
| Related mails | Author | Date |
|---|---|---|
| Ryan Homer | Feb 29, 02:27 | |
| Ryan Homer | Feb 29, 02:33 | |
| Steve Christensen | Feb 29, 02:59 | |
| Andreas Monitzer | Feb 29, 03:27 | |
| Ryan Homer | Mar 2, 15:18 | |
| Ryan Homer | Mar 2, 15:24 | |
| Adam Leonard | Mar 3, 00:00 | |
| Nir Soffer | Mar 3, 01:21 | |
| Evan Gross | Mar 3, 12:27 |






Cocoa mail archive

