Importing and Converting iTunes XML Files To Media Center 19 Mac
A Tutorial by Maeghaus
If you're attempting to import playlists from iTunes to MC 19 Mac, you can use the M3U converter offered by JRiver (see above). The converter is very handy, and will save you a lot of messing about with text editing.
However, at least as far as my experience goes, the converter does not import items such as play count ("Plays" in iTunes, "Number Plays" in MC) and other similar info. These items are stored in the iTunes XML file. To import iTunes playlists with this additional info, you need to export each playlist as an XML file, modify the file paths, and then import each playlist into MC.
Editing XML files is not as complicated as it seems. What you need to edit them is an XML file editor. Dashcode (an Apple Developer program) used to be the editor of choice, but Apple no longer supports this program, and it will not run on Mavericks (10.9). I have found that Bare Bones Software's free editor TextWrangler to be an admirable replacement program. I do not recommend Apple's Text program. It will open the file but may not correctly save the XML structure.
This procedure works under iTunes 10.7 and 11.x and was originally used in MC 18. The procedure is adapted for MC 19 for music files (MC Mac as of this post does not support other media formats yet. Importing Video may end up being similar or a different procedure entirely).
This procedure takes place entirely on the Mac side. I need to test a PC>Mac conversion to explain any differences that may arise with that process.
1. You can export an iTunes playlist to XML format by highlighting and then right-clicking on the playlist in iTunes. Choose Export. A file save dialog box will appear with some format options. Be sure that "XML" is selected. Save the file to a location (such as making a folder called "XML" and saving the playlist there). If you have multiple playlists to export, a file folder will help you to organize them into one location. I suggest saving a copy of the unedited XML playlist in case you need to edit again or the process doesn't work initially. You can always export the playlist again in iTunes and start fresh that way.
[Edit by JimH -- Steps 2 to 5 can be replaced by using
MrC's method below.]
2. This part of the process is dependent on your music's file folder location(s). Note the path -- write it down or copy to clipboard, some way to reference the path.
-- For Example: If you use the default Apple iTunes music folder location, under Get Info, the file folder would be /Users/<username>/Music/iTunes.
-- Another Example: On a different/external drive, the file path adds the location "/Volumes/<drive name>" plus any subfolders (say, "Volumes/<drive name>/<subfolder>".
-- For additional/different file location, use Get Info to see the file path. The Get Info function will reveal your complete file location path.
2. Next you need to open the XML file in your editor. Open the XML editor and select the playlist file. (File>Open in TextWrangler). The program should open up a structured code file. Ignore the wall of text and focus on the area where you will do the actual editing, the file locations.
3. Now you can begin editing the file locations so that MC will be able to see where the files are located. The first area to look in is:
<key>Music Folder</key><string>file://localhost/[drive volume]/<string>Example 1: <key>Music Folder</key><string>file://localhost/Volumes/Tom's%20Media%20Library/</string>Example 2: <key>Music Folder</key><string>file://localhost/Users/tomp/Music/-- Delete the following text
file://localhost, leaving the directory [drive volume] intact.
4. Next, look for the first music file entry further down the list. This entry will look similar to:
<key>Location</key><string>file://localhost/<file folder>/[Artist]/[music file]</string>Example: <key>Location</key><string>file://localhost/Users/tomp/Music/ABBA/01%20Mamma%20Mia.mp3</string>With multiple entries in a typical XML playlist, manually editing each track is time-consuming to say the least. You can shortcut by using the Find/Replace function in your editor. In the case of TextWrangler, it's under Search>Find. You should see the Find and Replace options. Type or Paste in Find this text:
file://localhost (no slash at the end)
For the Replace option, leave that blank. Select the command
Replace All. Even if you have a large playlist of hundreds of songs, the conversion of the Replace All process takes only seconds.
5. Save the XML file.
Repeat the process for each iTunes playlist you need to export and edit. TextWrangler has a Multiple Files search-and-replace function that can batch edit several XML files at once. All you need to do is edit each file as stated, and then select Multiple Files to select the XML files you want to convert. Remember to Save each file after completing.
6. Import an XML file into MC: In Media Center 19, select File>Import Playlist, choose a file, and click Open. The importing process may take a few minutes if you have a large file; just be patient. MC will show that it is processing in the Action window. Also, not only will you have an imported playlist from iTunes, but any music files that were not previously in MC will be imported as well. Don't worry about duplicate files; MC won't import a music file again if the file path already exists in the program.
Process compiled as of April 29, 2014. Please ask questions if you need, or if you discover errors in the process as stated above.
I would be pleased if JRiver would make this a sticky, or at least a Wiki reference. But that's up to you guys.
-- Tom