Re: Best Strategy to Control iTunes
Re: Best Strategy to Control iTunes
- Subject: Re: Best Strategy to Control iTunes
- From: "Luca C." <email@hidden>
- Date: Tue, 31 Mar 2009 21:57:54 +0200
2009/3/31 Ammar Ibrahim <email@hidden>
>
> My application will be adding/removing tracks to iTunes. I will not be
> controlling playback or anything like that, it's mainly to manipulate the
> database and playlists.
>
If you want that, you may want to use NSAppleScript.
> 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. This could happen in some situations. You may want
to take a look to the NSThread class, in particular the
detachNewThreadSelector::: method.
HTH
--Luca C.
_______________________________________________
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