Re: Quandary : NSAppleScript ties up main thread
Re: Quandary : NSAppleScript ties up main thread
- Subject: Re: Quandary : NSAppleScript ties up main thread
- From: Jens Alfke <email@hidden>
- Date: Mon, 10 Oct 2011 17:01:40 -0700
On Oct 10, 2011, at 4:41 PM, Jerry Krinock wrote:
> NSAppleScript does not seem to have any asychronous/callback methods for executing scripts. The only solution I can think of is to not use it. Instead, maybe launch the script as an application, and return the result by writing it to a temp file which I'm observing with a kqueue, or some other form of interprocess communication. I don't think AppleScripts can talk to Mach ports.
>
> Any suggestions to make this simple little enhancement less painful?
Try using NSTask to launch /usr/bin/osascript. You can read the script’s return value from the task’s stdout.
—Jens_______________________________________________
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