Subject: Re: Best Strategy to Control iTunes



2009/3/31 Ammar Ibrahim <ammar.ibrahim@xxxxxxxxx>
>
> 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 (Cocoa-dev@xxxxxxxxxxxxxxx)

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/maillists%40codeha.us

This email sent to maillists@xxxxxxxxx

...



Privacy