Re: "hooking" into another app
Re: "hooking" into another app
- Subject: Re: "hooking" into another app
- From: Jens Alfke <email@hidden>
- Date: Tue, 15 Apr 2008 14:37:27 -0700
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
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden