Hi all,
I’m trying to find a way to get an AppleScript to run without it blocking the main thread of my application. (The application happens to be made with REALbasic, but that shouldn’t really be important, I hope).
Here’s my current problem. If I run my AppleScript (which asks iTunes for some info about a track based on the track id), the script can sometimes take a few seconds to run. Whilst it is running, it blocks the application’s main thread (as would be expected), which causes audio dropouts in QuickTime movies I am playing.
I do all other file loading and access on a background thread in my app, to avoid disturbing QuickTime’s audio playback. But I don’t know how to do this for AppleScripts.
So, what I think I need is to find some way to:
- Run an AppleScript from a background thread from my application (is this possible?)
- Obtain the information from iTunes, from a background thread, via some other means (would AppleEvents be useful here?)
Any ideas much appreciated!
Dave.
Browser: Safari 416.12
Operating System: Mac OS X (10.4)