Re: Menu Items and the kAXPickAction Action
Re: Menu Items and the kAXPickAction Action
- Subject: Re: Menu Items and the kAXPickAction Action
- From: Andrew Taylor <email@hidden>
- Date: Sat, 31 Aug 2002 16:50:09 -0400
At 12:35 PM -0700 8/31/02, Michael Kamprath wrote:
on 8/30/02 8:46 AM, Eric Schlegel at email@hidden wrote:
On Thursday, August 29, 2002, at 10:48 PM, Michael Kamprath wrote:
When ever I use the Accessibility API to send a menu item that
kAXPickAction
action message, if the menu item belongs to an Application that is not
the
current front application, the action does not occur until that
application
is brought to the front.
Is this the intended behavior of the Accessibility API? Is there any
way to
make the kAXPickAction action occur while the application remains in
its
current non-front layer?
Interesting point. We hadn't considered that aspect of the action.
It's not "intended behavior", but it doesn't surprise me either. In
order to implement the pick action, we have to fool the app into
thinking a mouse-down landed on the menubar. Background apps have
hidden menubars, so the app probably doesn't get an inMenuBar response
from FindWindow when it checks the mouse position.
It in a way makes sense to me that the kAXPickAction only works when an
application is in front, as OS handling of the menu events aside, most
applications disable menu items when it's windows receive a disable event.
Even though the application's front window would imply to the user that some
menu items are enabled, the application not being in front implies that its
front window is inactive and in turn the application's implementer might
have the menu items disabled.
Does this boil down to an UI design issue then? Should menu items be
available for picking if the application is not the front application?
I have been in the speech command & control game for many years and
the issues you are talking about have been issues that I have been
battling for years.
One thing that had best be considered when doing remote control of an
application is: What does the application expect?
The people writing the application are expecting that a normal person
is using the application with normal reaction speed.
So while I have been frustrated by this I have learned the following:
Don't try to do something a person can't do via the User Interface or
through the AppleEvent interface.
Have throttling mechanisms in your code so that you can slow your
program down to human speeds. You should have this available on a per
application basis.
So while Eric might be able to make the Accessibility API operate the
menus of an application in the background, that application may or
may not respond because it is not expecting any user input.
All that said, with the new multiprocessing/multitasking features of
the Mac OS X and the new speed of the new machines, it would be great
to be able to remotely control a background application through this
interface.
We would be able to combine the capabilities of applications in new
and powerful ways.
Please file a feature request and I'll see if I can make this work
somehow.
Right now my code is bringing the target application to front, executing the
kAXPickAction, then putting the original front application back in front. I
find this adequate for now. I think, however, that though I'd sure menu item
selection in background applications can be implemented, the questions I
pose above probably need to be answered first.
Personally, I am a fence-sitter on the the answers to the UI design issue of
this. I just realize that either answer has its own set of causal
implications.
-eric
Michael F. Kamprath
email@hidden
Keyboard Maestro - Conduct Your Mac Like a Pro!
Download a free copy today at: www.KeyboardMaestro.com
_______________________________________________
accessibility-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/accessibility-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
accessibility-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/accessibility-dev
Do not post admin requests to the list. They will be ignored.