Questions tagged [ituneslibrary]

The iTunes Library framework provides facilities for retrieving the properties of media items in a user’s iTunes library.

The iTunes Library framework provides facilities for retrieving the properties of media items in a user’s iTunes library.
This framework was designed to replace the iTunes XML file that developers query to fetch track and playlist metadata. iTunes library access is read-only.

#import <iTunesLibrary/ITLibrary.h>

NSError *error = nil;
ITLibrary *library = [ITLibrary libraryWithAPIVersion:@"1.0" error:&error];
if (library)
{
        NSArray *playlists = library.allPlaylists; //  <- NSArray of ITLibPlaylist
        NSArray *tracks = library.allMediaItems; //  <- NSArray of ITLibMediaItem
} 

Important: You must code sign your app in order to get information back from the iTunes Library framework.

18 questions
10
votes
3 answers

Using new iTunesLibrary Framework to access iTunes library on Mac OS-X

I've been looking at adding iTunes Library access to a Mac app I'm developing. I looked at some of the existing open source implementations, such as EyeTunes and iMedia - but found them to not be quite what I was looking for. Overkill in general. So…
sckor
  • 457
  • 4
  • 13
9
votes
2 answers

Is it possible to save a music from the Ipod library into my app with swift?

I have the reference of an MPMediaItem when a user selects an audio from the iPod library. I am getting the asset URL of that item by using let url = item.valueForProperty(MPMediaItemPropertyAssetURL) But this is not giving me the exact physical…
user6777252
2
votes
1 answer

ITLibrary gives me nothing but (null)

My program automates a radio station. There is lots of communication back and forth between it and iTunes. I programmed it with scripting bridge. Scripting bridge suffers from memory leaks. Each call to scripting bridge leaks a small amount of…
Irv Heller
  • 31
  • 3
1
vote
1 answer

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

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…
1
vote
1 answer

ITunes Library Framework in Swift 5.2

I have searched everywhere and I am unable to find a swifty example of how to use the Apple ITunesLibraryFramework. I have been trying to figure out how to use this Framework in Swift 5.2. I want to get information directly from the Music library…
SouthernYankee65
  • 1,129
  • 10
  • 22
1
vote
1 answer

What API is there for selecting iTunes library location?

How does one programatically set the iTunes library location on macOS to custom locations using e.g. C / Obj-C or Swift API? Alternatively, environmental settings, such as modifying plists, using the defaults CLI tool, or similar approaches, are…
Dan
  • 1,258
  • 1
  • 10
  • 22
1
vote
1 answer

How does Songkick import your iTunes data?

Today I found Songkick.com which offers the possibility to scan your iTunes library, how do they do it? I tried to google around but I couldn't find an API from Apple for it, do you have any idea?
Simone D.
  • 43
  • 4
0
votes
0 answers

ITLibrary.mediaFolderLocation [macOS Monterey]

So I created a new Music library using option+click when I opened the Music.app. The new location is on an external drive at file:///Volumes/Dummy/Music/Test. That is now the default library when I open the Music.app. However, when I run my app…
SouthernYankee65
  • 1,129
  • 10
  • 22
0
votes
1 answer

ITLibrary: The operation couldn’t be completed. (OSStatus error 7011.)

Usually, initializing ITLibrary works like a charm. But when calling NSError *error = nil; ITLibrary *library = [ITLibrary libraryWithAPIVersion:"@1.0" error:&error]; on a customer's machine, I get a The operation couldn’t be completed. (OSStatus…
Hendrik
  • 5,085
  • 24
  • 56
0
votes
1 answer

iTunesLibrary Swift 5.3 macOS

After reading the documentation and looking through the header files of the iTunesLibrary frameworks I am unable to determine how, or if it's even possible, to manually specify the iTunes/Music library file to read? The documentation within the…
SouthernYankee65
  • 1,129
  • 10
  • 22
0
votes
0 answers

Swift: iTunesLibrary musicFolderLocation returns wrong location

I have written an app to help me sync my music from iTunes to other devices, but since I have upgraded to Catalina, I am getting the wrong path to my library. import Foundation import iTunesLibrary class ItunesHelper { var library: ITLibrary; …
Slawa
  • 31
  • 5
0
votes
0 answers

Access hidden dynamic Property in COM-object with C#

I need to access a specific property inside a COM object (the iTunes COM Library). You can access this property with the dynamic view of the Visual Studio debugger. I tried to get this property using Reflection but I don't get any private…
Felix
  • 81
  • 2
0
votes
1 answer

How to create a new ITLibMediaItem object?

I'm trying build an app that will work with iTunes. So, I imported the framework into my project and created a small class, just for learning purposes as follows: -(NSMutableArray *)processMediaItems:(NSArray *)mediaItems { NSMutableArray…
Bob Rivers
  • 5,261
  • 6
  • 47
  • 59
0
votes
1 answer

ituneslibrary framework iOS 8 beta

I am extremely new to world of iOS development. I am impressed by the speed I am realizing my ideas. Making good use of MPMediaQuery and such like. However I am struggling with plugging in the iTuneslibrary framework. My intended usage will be…
drewglew
  • 149
  • 1
  • 13
0
votes
1 answer

OSX Sandbox: Launch a different executable based on OS version

I have an application in the Mac App Store. I'm trying to support users going back to Snow Leopard but this is becoming increasingly difficult. Recently I've hit a roadblock due to the iTunesLibrary.framework, this framework must be linked to the…
Tim
  • 4,560
  • 2
  • 40
  • 64
1
2