Re: Executing AppleScripts from an 'AXTrustedProcess'
Re: Executing AppleScripts from an 'AXTrustedProcess'
- Subject: Re: Executing AppleScripts from an 'AXTrustedProcess'
- From: James Dempsey <email@hidden>
- Date: Mon, 2 Feb 2009 13:43:17 -0800
On Feb 2, 2009, at 11:53 AM, Tobias Zimmerman wrote:
I am working on an application that moves windows between displays by
executing AppleScripts (primarily against "System Events"). I have
found that granting my application rights using AXMakeProcessTrusted
(or, more accurately, the command line equiv of 'sudo chown
:accessibility appname; sudo chmod g+s appname'), causes the
AppleScripts to fail with error -2709 (cannot access scripting
dictionary). (I also tried after calling AXMakeProcessTrusted on my
app from a helper agent
First, is this a bug, or a security feature that restricts trusted
processes from executing AppleScripts that call other applications'
scripting dictionaries?
Second, is there a way around it, or am I stuck requiring my users to
turn on "Enable access for assistive devices" globally? When that is
on, the app works fine; but when it is granted individual permissions
it fails.
Any and all thoughts would be most appreciated.
Thanks
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Accessibility-dev mailing list (Accessibility-
email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
This is an issue that we are aware of. One workaround I had suggested
to a developer privately (but had not heard back if it had worked),
was to compile the scripts ahead of time using osacompile, and to load
and run the compiled scripts. I believe this would skip the step of
loading the AppleScript dictionaries of the other applications.
I'm not too familiar with osacompile, but you will want to use the -d
options to have the compiled script in the data fork, you probably
also want -x to make it execute only - otherwise it will be openable
in ScriptEditor.
I'm hopeful that as long as your scripts don't rely on scripting
additions that this will work. It would be helpful if you could
report back whether this did work for you or not.
-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