Mac Terminal Command Line command to perform the iTunes File->Library->Export Library action?

84 Views Asked by At

I would like to be able to, from the command line or in a Python script/program, execute the action that you can do manually in the iTunes application: File->Library->Export Library. So that I can have a copy of an up to date xml file of my iTunes library. Is this possible?

1

There are 1 best solutions below

0
On

I have searched for a solution to this problem for quite a lot of time. And I still have not found anything.

However, as I needed the XML only for the "played count" and "name" variable of each track I instead created an AppleScript which is then directly called in the python script in which I used to import the XML file.

Note that the AppleScript directly asks the Music app for up-to-date data but it does need the Music app to be running.

Maybe this can be adapted to work for your problem, too.

Hope this helps, Alex.