Re: Get the latest song pathname played by iTunes
Re: Get the latest song pathname played by iTunes
- Subject: Re: Get the latest song pathname played by iTunes
- From: Mario Diana <email@hidden>
- Date: Sun, 18 Jul 2004 07:56:14 -0400
On Sunday, July 18, 2004, at 06:10 AM, Lorenzo wrote:
I suppose I can tell my application to look inside some iTunes
document and pick and play that tune.
So, do you know how to get the pathname of that song file?
iTunes uses an XML file located here:
~/Music/iTunes/iTunes Music Library.xml
If you wade your way through that, the information should be in there.
Before you jump in though I have to warn you that the format of the
file is a little "unconventional" as far as XML goes. In other words,
it isn't at all easy to parse. Is there an easier way? If there is, I
do wish someone would let me know.
I wrote an application that parses that file using Java. (The rest of
the app is Objective-C.) The source is available at Sourceforge, if you
want to take a look at it. You'll have to unpack one of the Jar files:
http://itms-backup.sourceforge.net
The code I wrote parses the pathnames of the songs listed in the
"Purchased Music" playlist. You can see from reading it the hoops you
need to jump through to get information out of that file.
Good luck!
Mario
=======================================================
Mario Diana Mobile: 845-380-8428
50 Forest Drive Home: 845-221-3989
Poughquag, NY 12570 Email: email@hidden
=======================================================
Programmer - Web development, Java, XML, LAMP, Mac OS X
=======================================================
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.