• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: What's the story with OSAScriptController and OSAScriptView.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Prev by Date: Re: help with closing file handle
  • Next by Date: AuthorizationExecuteWithPrivileges question
  • Previous by thread: Re: What's the story with OSAScriptController and OSAScriptView.
  • Next by thread: Why are paths depracated in favor of NSURL?
  • Index(es):
    • Date
    • Thread