Re: accessibility to help in my problem
Re: accessibility to help in my problem
- Subject: Re: accessibility to help in my problem
- From: James Dempsey <email@hidden>
- Date: Thu, 6 Nov 2008 07:12:02 -0800
On Nov 6, 2008, at 6:32 AM, Nick Rogers wrote:
Hi,
Thanks for the reply. I implemented apple script.
But in my particular case it doesn't work.
Its a bit complicated, but here it is:
MyApp is embedded inside MyApp.
I have the directory structure like this:
MyApp.app/Contents/MacOS/MyApp
and in the same dir i have:
MyApp.app/Contents/MacOS/MyApp.app //another app with the same name
which is launched by the outer app.
Since the app name is same applescript's "tell application "MyApp"
\n set bring front to yes\n end tell" doesn't target the right inner
app.
I was hoping there's some easier to read article on Accessibility
out there. Which could target some where near my problem.
If I'm able to implement accessibility in my app, will it require
turning ON something in the preferences or will it just work?
Thanks,
Nick
Nick - I believe AppleScript now allows you to identify an app by its
bundle identifier, so if the two apps had different identifiers, you
should be able to script them separately. I'm not certain what you
are trying to achieve with two identically named apps (for instance,
users of your app trying to script it will have the same difficulties
you are experiencing).
That said, using the AX API to control one of your apps from the other
app as you describe would be possible. However, the accessibility API
is definitely geared towards, and focused on accessibility, not
general purpose interprocess communication. For what you are trying
to do, you might want to take a look at Distributed Objects for your
interprocess communications.
http://developer.apple.com/documentation/Cocoa/Conceptual/DistrObjects/DistrObjects.html
Some reasons Distributed Objects may be preferable in your case:
1. If you go the AX route, users will need to turn on "Enable access
for assistive devices"
2. For simple communication between apps, DO is fairly straightforward
and well-documented
3. As you progress, you might find that there are things you need to
happen between your two apps that AppleScript or Accessibility do not
do. Since DO causes one app to call a method in another app, in the
method implementation you have the flexibility to make anything happen.
If you do go the DO route, my main piece of advice would be to keep
the communication between processes as simple as possible.
-James
--------------------------------------------------
James Dempsey
AppKit Engineering
Apple
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