• 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: Using NSApplescript while keeping UI responsive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using NSApplescript while keeping UI responsive


  • Subject: Re: Using NSApplescript while keeping UI responsive
  • From: email@hidden
  • Date: Tue, 27 Jul 2004 22:07:14 -0400

Quoting Edison Thomaz <email@hidden>:

> You are absolutely right Nick.... my bad!
>
> Thomaz
>
> On Jul 27, 2004, at 12:10 PM, Nick Zitzmann wrote:
>
> >
> > On Jul 27, 2004, at 12:44 PM, Edison Thomaz wrote:
> >
> >> The obvious answer to that would be to do
> >> all the NSApplescript work on another thread, but NSApplescript is not
> >> thread-safe (part of AppKit).
> >
> > NSAppleScript is part of Foundation, not AppKit.

Regardless of which framework NSAppleScript belongs to, it is most definitely
*not* thread-safe. I wasted a lot of time trying to get it to work a while
back, and it resulted in a lot of crashes...

If you want to send Applescripts in a new thread, you will need to fork a
separate executable for each Applescript you want to run in the background.
Fortunately, there's a command-line tool that does exactly this provided with
Mac OS X (assuming the BSD Subsystem is installed) - it's called osascript.
Type 'man osascript' in the Terminal for details.

Charles
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


  • Follow-Ups:
    • Re: Using NSApplescript while keeping UI responsive
      • From: Andrew Thompson <email@hidden>
References: 
 >Using NSApplescript while keeping UI responsive (From: Edison Thomaz <email@hidden>)
 >Re: Using NSApplescript while keeping UI responsive (From: Nick Zitzmann <email@hidden>)
 >Re: Using NSApplescript while keeping UI responsive (From: Edison Thomaz <email@hidden>)

  • Prev by Date: Re: earliest code that runs?
  • Next by Date: Re: earliest code that runs?
  • Previous by thread: Re: Using NSApplescript while keeping UI responsive
  • Next by thread: Re: Using NSApplescript while keeping UI responsive
  • Index(es):
    • Date
    • Thread