I’m working on a Mac app and I need it to scan the users iTunes library. Any idea how I would go about this? The app would scan the library looking for different song attributes.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
To find the actual most recent location of the iTunes library (and not hope for it to be at the default location) read the
iTunesRecentDatabasesoriTunesRecentDatabasePathsproperty from~/Library/Preferences/com.apple.iApps.plist.For a more advanced code snippet look for
parserInstancesForMediaType:in iMedia‘s IMBiTunesParser.mFor the actual database parsing it is recommended to use a SAX parser, such as
NSXMLParser(vs. a tree parser, such asNSXMLDocumentor even worse:NSPropertylistSerialization) as some users have librares with up to and sometimes even more than 100,000+ tracks. Using tree parsing or even serialization will seriously slow down and potentially block your app temporarily.