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: Tue, 3 Feb 2009 16:11:48 -0800
On Feb 3, 2009, at 3:56 PM, Tobias Zimmerman wrote:
From: James Dempsey <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.
Thank you for the interesting suggestion. Unfortunately, I cannot
precompile the scripts, because I need to fill in the appropriate
parameters for the window size/location at run time. (OT, but I think
I have also identified a memory leak in the OSA Compile functions.
They seem to generate a number of CFStrings when compiling a script
that are never released/collected. I am investigating further and
will post something to cocoa-dev if I can confirm it). I am glad
Apple is aware of the issue -- see my comment above regarding having
to enable a global right when a specific right will do. Hopefully it
will get corrected at some point. Keep making great stuff!
Thanks, Tobias
If you do have a reproducible example of a leak, please file a bug at
bugreporter.apple.com, and include all the information you have. A
bug filed is infinitely more likely to be acted upon within Apple than
a post to a mailing list (which may or may not be seen by the
appropriate person to fix the issue).
You need to be a member of ADC to use bugreporter, but a free online
ADC membership is fine.
bugreporter.apple.com is the best way for developers to report issues
and enhancement requests - although it is largely one-way
communication. You don't get any status information, but we
definitely see them in engineering.
For your specific case, why don't you move the windows directly
using Accessibility? (I'm doing this myself in an upcoming app.)
It's more work but rarely fails.
This sounds intriguing. Can you point me at a good place to start
researching how to do this (or, even better, give me an example?) I
am an amateur, just getting started with Cocoa, and had done all of
this in pure applescript before hand, so that is where I am coming
from.
The like to the documentation is:
http://developer.apple.com/documentation/Accessibility/Reference/AccessibilityLowlevel/index.html
Also please file a documentation bug, at bugreporter.apple.com, if you
feel the documentation could use some improvement.
-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