Re: Async AppleScript Commands
Re: Async AppleScript Commands
- Subject: Re: Async AppleScript Commands
- From: Michael Robinette <email@hidden>
- Date: Thu, 18 Sep 2003 14:54:19 -0700
On Thursday, Sep 18, 2003, at 12:32 US/Pacific, Nick Zitzmann wrote:
On Thursday, September 18, 2003, at 11:31 AM, Michael Robinette wrote:
I'm adding scripting support to my app and it's working well. One of
the events I handle invokes an async transaction in my app, but I
want it to return the result of the transaction.
Is there a good way to queue the script command until the async
transaction is done? or do I have to do it myself?
One way of doing this is to use a lock to block further execution
until the transaction is finished, like this... (note: written in
Mail, untested, use at your own risk)
Right. I'd do it differently so that I don't block the main run loop
waiting = YES;
[self doAsyncStuff];
while( waiting )
{
CFRunLoopRunInMode( kCFRunLoopCommonModes, 1, YES );
}
return asyncResult;
However, if I do it that way, I assume I need to make the
scriptCommandHandler reentrant?
- michael
_______________________________________________
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.