Re: Using NSApplescript while keeping UI responsive
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.