On Tue, Mar 31, 2009 at 3:57 PM, Luca C. <luca.pazzere...@gmail.com> wrote: > 2009/3/31 Ammar Ibrahim <ammar.ibra...@gmail.com> >> If I want to add a track to iTunes, I need to make sure iTunes is >> responsive. >> >> > Are you sure it is that important? Actually, if you run an AS script wich, > say, opens with the Finder some mp3 files whilst iTunes has dialog windows > opened, the command will be automatically enqueued. In other words, your > tracks will be added after the user closes the dialog window. > Run the script in a separate thread so it won't block your application's > interface in any case.
No, don't do this. AppleScript is not safe to use outside the main thread. If you must run AppleScript asynchronously, either spawn a subprocess to run it or, better yet, don't use AS at all but send Apple Events in some other way, such as with ScriptingBridge. Mike _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com