问题
On OS X, is there a way to ask iTunes for all the tracks it has, with some metadata (I'm most interested in the number of plays), and the filenames of the tracks (alternatively, simply a way to play them would be fine as well).
I know I could probably hack something up reading the iTunes database, but I'm looking for a solution that is not considered off-limits for acceptance into the Mac App Store.
Is this possible?
回答1:
iTunes is a program - not an intrinsic unremovable part of the operating system like it is on iOS - which is why there is not a dedicated SDK on OSX. You can access via iTunes via AppleScript.
There are applications on the Mac app store that are just GUI's on top of AppleScript. http://dougscripts.com/itunes/category/mac-app-store/
来源:https://stackoverflow.com/questions/14744832/get-list-of-tracks-and-filenames-or-a-way-to-play-them-from-itunes-on-os-x