I'm new to Swift, back when I did iPhone development it was Objective-C only. And as far as writing for the Mac goes, I'm mainly a Windows developer. So forgive me if the answer is obvious, but I'm trying to create a tool for myself that will download all of my iTunes library (which is currently all in the cloud) and stick it on an external hard drive. I can get the library metadata easily enough, but I can't seem to find a way to get the actual file for the ITLibMediaItem.
For fun, here is my current chunk of code. Really just coding in a sandbox app trying some things currently.
let library = try? ITLibrary(apiVersion: "1.1")
let songs = library?.allMediaItems
for item in songs! {
if (item.mediaKind != ITLibMediaItemMediaKind.kindPodcast && item.mediaKind != ITLibMediaItemMediaKind.kindTVShow)
{
print("Song title: \(item.title)")
}
}