• 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: NSAppleScript not in the main thread
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSAppleScript not in the main thread


  • Subject: Re: NSAppleScript not in the main thread
  • From: Craig Altenburg <email@hidden>
  • Date: Fri, 19 May 2006 17:39:04 -0400

I needed to run an applescript from my application that would send events to my application.

I tried a number of things to make this work with no great success.

Finally I wrote a little "Script Helper" application. This faceless app can be embedded into my main app's package. When I need to run a script I launch the helper and send it the script. It can then send events back to my main app as needed. If the helper is idle for more than a few minutes it quietly goes away.

The project is still in development so this has not had a ton of testing but, so far it has worked great for me.

On 19 May 2006, at 4:47 PM, Christoph Vogelbusch wrote:

Hi,

I just read in the "Multithreading Programing Topics" that NSAppleScript should only be used from the main thread.

My "application" is running as a plug-in in iTunes and I want to extend the song information using NSAppleScript.
As the plug-in is not running in the main thread I could never run my AppleScript from the main thread and as NSAppleScript is slow I want to create a separate thread for the AppleScript calls.


What kind of problems can I expect from running AppleScript from another thread (and accessing the same application with it)?
How can I avoid these problems?


Greeting from Germany
Christoph Vogelbusch
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden

Attachment: PGP.sig
Description: This is a digitally signed message part

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >NSAppleScript not in the main thread (From: Christoph Vogelbusch <email@hidden>)

  • Prev by Date: Re: Trouble using ANY operator in an NSArrayController search predicate
  • Next by Date: Re: Shared Instance of a class
  • Previous by thread: Re: NSAppleScript not in the main thread
  • Next by thread: Re: NSAppleScript not in the main thread
  • Index(es):
    • Date
    • Thread