Noobie having trouble getting to first base..
Noobie having trouble getting to first base..
- Subject: Noobie having trouble getting to first base..
- From: David Hoerl <email@hidden>
- Date: Thu, 3 Jan 2008 10:44:37 -0500
I want to target an App using the Accessibility framework. I
purchased a copy of the "UI Browser" (an indispensable tool for
exploring any app's interface!) and verified that this app would
cooperate.
So, I tried writing to mimic what UI Browser found in my own code,
but hit a wall real early on.
AXUIElementRef axApp;)
CFArrayRef names;
pid = "get pid the usual way"
axApp = AXUIElementCreateApplication(pid);
axApp -> appears to be some reasonable number
AXAPIEnabled() -> YES
err = AXUIElementCopyAttributeNames(axApp, &names);
err -> -25204 (kAXErrorCannotComplete)
So, in googling this error, it appears that my app needs to be
"trusted". I add another test to my code:
AXIsProcessTrusted() -> 0
Thus, it would appear I need to make my app trusted by calling
AXMakeProcessTrusted(path) once, as root. Apple just released updated
sample code that shows the current recommended way of doing this:
http://developer.apple.com/samplecode/BetterAuthorizationSample/index.html
Pondering my next move, I suddenly recall "Hey, I don't remember UI
Browser asking me to authenticate itself!" [But it could have, and I
just forgot!]
So, before I go and do all this work to adding in the authentication,
I figured I just post here first and see if I'm on the correct path
(and also, how did UI Browser do it?)
David
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Accessibility-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden