• 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: Async AppleScript Commands
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Re: Async AppleScript Commands (From: Nick Zitzmann <email@hidden>)

  • Prev by Date: Re: Writing a protected method in Obj-C
  • Next by Date: Re: NSSaveView and odd NSCFArray errors
  • Previous by thread: Re: Async AppleScript Commands
  • Next by thread: Apple nice web pages: how to do?
  • Index(es):
    • Date
    • Thread