Re: Noobie having trouble getting to first base..
Re: Noobie having trouble getting to first base..
- Subject: Re: Noobie having trouble getting to first base..
- From: John Louch <email@hidden>
- Date: Thu, 03 Jan 2008 07:57:33 -0800
- Thread-topic: Noobie having trouble getting to first base..
When you call AXAPIEnabled and it returns true. It mean accessibility is on
for all clients. I.e. You have probably checked the box in
Preferences/Universal Access "Enable access for assistive devices".
KAXErrorCannotComplete means one of two things.
1) The accessibility connection for that port could not be found
2) The message to that connection failed in some manner
I bet in your case it is #1.
So are you sure your pid is correct, are you in the same session as the
application you are talking to?
Thanks,
jl
> 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
--------------------------------------------------
John Louch Internet #: email@hidden
_______________________________________________
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