Re: What's the story with OSAScriptController and OSAScriptView.
Re: What's the story with OSAScriptController and OSAScriptView.
- Subject: Re: What's the story with OSAScriptController and OSAScriptView.
- From: has <email@hidden>
- Date: Sat, 9 Feb 2008 13:53:19 +0000
On 9 Feb 2008, at 12:05, email@hidden wrote:
My app needs to run concurrent scripts.
At present I am firing them off into separate tasks wrapped around
NSAppleScript.
That would be the safest way to do it, assuming you need to use
AppleScript in the first place. Are these user-supplied scripts
you're running, or are they private to your application?
The scripts will be user supplied and scheduled so concurrency is a
must.
I'd suggest searching the AppleScript-implementors archives for
previous discussions of AppleScript and cooperative threading, and
posting requests for additional help there.
Bridges etc won't really cut the mustard here I think.
My scripts wrapped in NSTask approach does work but the overhead is
huge for trivial scripts.
But it looks like it might be the only option.
If you do stick with the multi-process approach, you could reduce your
overheads by maintaining a persistent pool of 'script runner'
processes and each time you need to run a script, just stick it in an
Apple event and send it to the first available runner. The runner can
create a new AppleScript component instance to provide a clean
context, run the script in it, and dispose of both when done.
HTH
has
--
http://appscript.sourceforge.net
http://rb-appscript.rubyforge.org
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden