• 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: Quandary : NSAppleScript ties up main thread
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Quandary : NSAppleScript ties up main thread (From: Jerry Krinock <email@hidden>)

  • Prev by Date: drawRect not being called by NSCollectionView..
  • Next by Date: How to get info about an iOS device (UDID, etc)?
  • Previous by thread: Quandary : NSAppleScript ties up main thread
  • Next by thread: Re: Quandary : NSAppleScript ties up main thread
  • Index(es):
    • Date
    • Thread