Re: Best Strategy to Control iTunes
Re: Best Strategy to Control iTunes
- Subject: Re: Best Strategy to Control iTunes
- From: Michael Ash <email@hidden>
- Date: Tue, 31 Mar 2009 20:52:59 -0400
On Tue, Mar 31, 2009 at 3:57 PM, Luca C. <email@hidden> wrote:
> 2009/3/31 Ammar Ibrahim <email@hidden>
>> 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 (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