FROM : Jens Alfke
DATE : Tue Apr 15 23:37:27 2008
On 14 Apr '08, at 2:39 PM, Bill Cheeseman wrote:
> However, the
> Accessibility API is also wonderfully useful for doing lots of other
> things,
> such as hooking into a text chat window so that you can log the
> incoming
> messages.
I'm not so enthusiastic about it … it's basically the GUI equivalent
of Application Enhancer, or of HTML screen-scraping. Just as searching
through the raw HTML of a website isn't a reliable way to get
information from the server, groping through the views of another app
isn't a reliable way to interact with it. In both cases, there's
nothing to keep the layout of the user interface from changing in the
future, and even minor changes that don't have a visual effect could
break anything that's groping inside them. (For example, if the order
of two buttons gets changed around for some reason in a nib, something
using the accessibility API to drive those buttons is going to end up
pressing the wrong one.)
I understand that sometimes there isn't any other way to get something
done, but IMHO using accessibility to do such things is in the "skanky
hack that just happens to work" category. In the case of iChat it
would be a lot better to use its existing AppleScript support to add
handlers for when messages are received.
—Jens
DATE : Tue Apr 15 23:37:27 2008
On 14 Apr '08, at 2:39 PM, Bill Cheeseman wrote:
> However, the
> Accessibility API is also wonderfully useful for doing lots of other
> things,
> such as hooking into a text chat window so that you can log the
> incoming
> messages.
I'm not so enthusiastic about it … it's basically the GUI equivalent
of Application Enhancer, or of HTML screen-scraping. Just as searching
through the raw HTML of a website isn't a reliable way to get
information from the server, groping through the views of another app
isn't a reliable way to interact with it. In both cases, there's
nothing to keep the layout of the user interface from changing in the
future, and even minor changes that don't have a visual effect could
break anything that's groping inside them. (For example, if the order
of two buttons gets changed around for some reason in a nib, something
using the accessibility API to drive those buttons is going to end up
pressing the wrong one.)
I understand that sometimes there isn't any other way to get something
done, but IMHO using accessibility to do such things is in the "skanky
hack that just happens to work" category. In the case of iChat it
would be a lot better to use its existing AppleScript support to add
handlers for when messages are received.
—Jens






Cocoa mail archive

