iTunes metadata and artwork

I had archived a number of things you helped me out with. (turingtest2). One was "exportimport" script. I tried clicking the link in an old posting and it comes up with a 404 error. Is there a way that could be reposted here?


Also had help in trying to maintain the metadata and album art when replacing files in itunes. I got a few different scripts ( Create Folder Art, Update Tag Info, Sort Date Added and then a few different Date Arranger scripts). I had instructions on the order of how to make sure the album art stays on the file but my notes appear to be incomplete as I don't recall the order/steps necessary for that. I believe it was the create folder art script but the sequence of that is what I've forgotten.


I know itunes is not viable much these days but what I am trying to do is replace all the existing titles in my library that are mp3 160 baud with either 320, or even wav, AIFF or FLAC (perhaps AAC).


It seems no matter what I do, I cannot get it to work properly despite all the wonderful guidance you provided. So here's the gist of what I'm attempting.


  1. Use the newer, high quality versions of the same song for all the songs in the library.
  2. Keep all the same information already on the file. This includes the rating, genre, album art, comments, composer, etc. All the metadata that's on the original file.


So each song will just be the newer, better quality version. My plan is to use AIFF or FLAC files as technology seems to be improved to handle these. But if AAC Apple Lossless is the better option, I can do that. But I do want the best possible quality as space is no issue these days (hard-drives).


Any help would be greatly appreciated.

Posted on Aug 27, 2020 1:15 PM

Reply
Question marked as Top-ranking reply

Posted on Sep 1, 2020 3:49 PM

Hi,


I've updated ExportImport to capture artwork. This is the easier tweak. When running in export mode an image is created for each unique album and saved in same folder as the script in the form <Artist> - <Album>.jpg and another line is added to the exported information for that track. In the import phase the current file is checked to see it it has art, and if not, and if there is an image at the saved path, then it is inserted. As a test I used the script to export data for 27 tracks from three albums. I then removed the artwork and used the import mode to restore the artwork.


So step by step:


  1. Select some tracks that you want to upgrade in iTunes.
  2. Run the ExportImport script.
  3. Replace the low resolution files with your higher rate conversions, in the same file format, and at the same paths.
  4. Drag and drop the Export Import [<Date> <Time>].txt file that was created onto the ExportImport script.
  5. Review the updated files in the library and Explorer to check that all the properties have been restored, artwork embedded, etc.


After reviewing the code for the script I've seen how you can use it to upgrade, for example, mp3 to Apple Lossless. Step 3.1 would be to edit the exported data file in a text editor and perform a search and replace operation to change .mp3 to .m4a before saving the file. As long as you've removed the .mp3 files the script will attempt to relink iTunes to the path specified in the text file.


I should be able to add in something more elegant during the import phase that checks for the existence of a file at the location noted during export of <path>.ext and, if it isn't there, looks to see if there is a file with another valid extension from the list <path>.aif, <path>.mp3, <path>.m4a, <path>.wav, etc. If a potential match is found the script can then relink iTunes to that file before restoring the other properties.


tt2

Similar questions

352 replies

Sep 16, 2020 2:53 PM in response to turingtest2

Yes, the very last capture was after I "pasted" the image inside the Artwork tab of the song file in iTunes.

The capture directly above it (with Tom Petty album) was where the image was grabbed by iTunes using "Get Album Artwork."


I've discovered that when I use that last manner, it will show in iTunes. However, it won't show in Windows Explorer - which is as you said (that iTunes doesn't write it to Windows or whatever you said).


That seems to be why PLEX isn't seeing the proper album covers. So I have a scattering of many, many Get Album Artwork images along with many I did by pasting in, or dragging from another browser and dropping into iTunes.


However - as it relates to PLEX, I completely created a new Folder and put in about 15 songs with only songs/albums windows explorer displayed properly but it still doesn't grab them all correctly. Perhaps it's because they're in other folders in that drive directory (Plex is not your concern, I realize). I'm just trying to figure out what to do.


The thing that's frustrating is that - even if I use your CleanDeadArt script and run it in a folder with wrong artwork on albums as well as a lot of dead or bunch of images, it gets rid of those, but Windows still shows wrong art on many (except those that were pasted into iTunes). So it's a conundrum:


  1. Is there any way to get iTunes to write to Explorers properly so it matches album art inside iTunes to what shows in windows?
  2. If not, do you have any idea of how to somehow get rid of images that are wrong? Perhaps a script where I highlight the wrong ones and try to tie them to the right artwork? Not sure this question even makes sense.
  3. Is there a way to tell which images in iTunes were grabbed by iTunes and which ones I did myself? Unlikely, but just asking.


I am going to restore my computer to pre-dBpoweramp (I think I set a restore point - I hope I did).


Could this be a iTunes 10.7 issue in any way?

Sep 16, 2020 3:40 PM in response to turingtest2

I uninstalled that dBpoweramp. (I can reinstall again if I want).


That said, I chose a couple of song files I did today and they had the wrong image in Windows, but I had gotten the album art from iTunes. Here's the look in Windows.



What I did was copy the large image in the left side (iTunes 10.7) and then copied it. Then went to Get Info and pasted it on top of the image already there and saved it. Here's the song in iTunes:



I then went back to Windows and it's there properly now:



Time and so many files later, I

don't know which artwork was iTunes versus those I dropped into the song. It

would mean doing this song-by-song for some nearly 17,000 tracks. Crazy.




A quick question: YOU SAID: You can use also use the small box at the top left to copy in artwork downloaded from the web if iTunes cannot get the right artwork for you. Hopefully the distinction between embedded artwork and store associated artwork is now clear.


ME: What small box are you referring to?

Sep 16, 2020 4:44 PM in response to William Richards3

This is how running ExportImport should work when iTunes has the correct art, and Windows Explorer has nothing, or something else:


Export phase:


Import phase - I've replaced the .mp3 files with Apple Lossless copies derived from .wav originals:


Import complete, metadata restored and artwork embedded:


I just discovered that it needed another tweak to ensure that artwork was embedded during the import phase, so time to get yet another build of ExportImport and test it out at your end.


tt2

Sep 16, 2020 4:47 PM in response to William Richards3

William Richards3 wrote:

BTW, do you have ANY idea of why so many songs have this one image on it? And how I can get them right?


I suspect that another Explorer extension might be supplying artwork to every music file based on a Folder.jpg image, or a private application cache stored elsewhere. It would take a bit of poking around to be certain. What happens if you delete the Folder.jpg image I can see in the screenshot?


tt2

Sep 16, 2020 5:03 PM in response to turingtest2

I deleted that Folder.jpg already earlier this afternoon to try to see if that did anything and it didn't.


I ran your updated CleanDeadArt script just now and it removed these:


But the one image on a great number of the songs, remain.


I'm still unclear on this:


ME: Are you saying that when I do convert to the higher quality and then replace the 160 that the upgraded versions, Windows will should have the right image embedded in it (without me having to go song-by-song to do as you suggested above)?


If you can get a script to automatically embed the current iTunes artwork, that's great. But what's confusing is it seems you're saying if I replace the 160 with the lossless file(s), the artwork will fix itself in windows? But then you're saying you could make a script to automatically fix artwork in advance of the upsampling project?


Thank you as always!

Sep 17, 2020 6:03 AM in response to turingtest2

I'm the one who just needs some extra explanation sometimes. You're doing awesome helping me here. I'll await your updated embedTunesArtwork script. Anything that can get this resolved is terrific.


Do you have any idea on how I might search for whatever explorer extension or private application cache might be causing these same image on multiple song files? I'll try to do some investigation myself and see if I stumble onto something.


I'm so thankful you've been helping me. I seriously don't know where I'd be without you.


I'm anxiously awaiting the new script(s). Sure appreciate it.


Thanks so much!

Sep 17, 2020 10:51 AM in response to William Richards3

Totally off our subject, but I was able to find a macro that made the names of artists for me (created folders for each in Windows Explorer in the location I indicated). I'm seeing several VBS scripts people have that show code on how to do more than one column but, a) I don't understand VBS at all, and b) none indicate the setup as I have in Excel. For example, here is the name of the artist in column A and the respective album title in column B.



I see your scripts are in this .vbs format and I wondered if there was any chance you could point me to what I could do, or perhaps even create a script that would create the Artist and Album (Folder/Sub Folder) automatically? It would have to not create multiple folders of the same name (Artist) while making sub-folders under that for the album name. I'm sure you follow, but only have one Beatles folder, but all the sub-folders underneath that have the album name.


If not, that is fine. You've done more than enough and I can't thank you enough for your help to date. Like I said, the macro will create the one column list and that worked great. But nothing I find - that I know how to do - is working and I've spent all day up to this point on trying to do this.


Thank you as always sir. I really, really appreciate all your help.

Sep 17, 2020 5:12 PM in response to William Richards3

I presume that each of these folders represents a playlist in your library, and that up until now you've used <Artist> - <Name>.<Ext> as your file naming strategy. Once you've added to content to iTunes it only looks at the metadata in the file so the path to the file no longer has any bearing on playlist membership, and track information comes from the tag rather than the filename and path. My scripts work with content from iTunes, so you select content to process there rather that working in the source folder.


Say, for example, that you wanted to reorganize what is in the Monty Python folder, which I assume corresponds to a Monty Python playlist. You would select that playlist in iTunes, then use Ctrl+A to select all the tracks inside. You would then run one of the scripts. ConsolidateByMoving will move things into the same shape that iTunes would generate, ConsolidateByMovingLong is the same but doesn't have the 40-character max. file or folder name limit that iTunes does, and CustomRenamer allows you to use a custom naming pattern other than the default <Media Folder>\Music\<AlbumArtist>\<Album>\<TrackNumber> <Name> layout the other scripts use.


The script would first ask for confirmation that you want to process the selected number of tracks, and allows for it to run automatically, or for you to give track by track confirmation of each action. You're then asked to edit or confirm the suggested media folder where the tracks are going to be moved to. For reasons discussed elsewhere (see Make a split library portable - Apple Community) I generally recommend this is X:\iTunes\iTunes Media, where X: is the drive hosting your library, but it can be wherever you want all of music files to live.


The script then examines each selected item in turn, calculates the intended path for that item, compares with the current location, and if necessary moves it, doing all the other housekeeping that is necessary to keep the track connected to iTunes (and in turn to any playlists it belongs to etc.) removing emptied folders, moving any folder art, etc. These are all things you can do by hand, but only with great effort.


Right now I see absolutely no benefit for you in using a macro in an Excel spreadsheet to build one layer of a folder structure when it doesn't do any of the other things necessary to move the files or update the library and ensure iTunes can keep working correctly.




iTunes playlists exist in iTunes as part of the iTunes Library.itl database. As long as this is maintained correctly there is no real need to export and reimport playlists. They are potentially useful if you want to use an iTunes list in another application such as Plex, VLC, etc. or a non-Apple device. iTunes has the ability to export playlists in a number of formats, e.g. ,m3u or ,xml. Playlists are text files with a custom extension that denotes their format. You can view them in Notepad, but I suggest Notepad++ is a better tool. It is also what I use to edit my scripts. The .m3u form is smaller and easier to read by eye, the .xml form contains more information, is less easy to read, but it is also possible to backup all of the library's playlists in a single xml file. This is what you get automatically if iTunes is sharing the XML file with other applications or manually by using File > Library > Export Library. Playlists are static and rely on absolute folder paths. If you're going to reorganize the layout of your files any playlists you make now couldn't be reimported after the reorganization because the files will be in different places. I don't currently have a solution for exporting all regular playlists, although it is a task that could be done with a script, and I already have a script that exports a single list, so it would be relatively easy to create an expanded version.



tt2




Sep 18, 2020 3:36 AM in response to William Richards3

<Ext> represents the file extension, mp3, m4a, etc.


OK, so the folders don't represent a playlist in iTunes, but do they match up with a collection of .wav originals don't they? I'm thinking about how you drive through the upgrade process. To use the ExportImport upgrade process you need to be able to identify these tracks in iTunes that you're going to upgrade so you can run the export phase, you then generate the replacement files, run the import phase, and finally you would run say ConsolidateByMoving to rearrange the new files into the pattern <Media Folder>\Music\<Artist>\<Album>\## <Name>.<Ext>. Again use a script to avoid any manual work moving files or fixing broken links in iTunes.


If what is in a given folder isn't already represented in your library then, in some cases at any rate, picking the tracks in the library that belong to a given folder might be tricky to do by hand. You can however drag the files in a folder to an empty playlist and iTunes will add those tracks to the list. This leads to the following suggested approach.



For this example I'm starting with a bunch of tracks in a folder called Big Bucket, named the same way that you have them, <Artist> - <Name>.<Ext>.


(1) Create an empty playlist in iTunes for tracks that you want to upgrade. Select the files in the folder with Ctrl+A. Drag the selection to the playlist and release.



(2) Run the ExportImport script in Export Mode to backup the metadata and artwork for this selection of tracks.


(3) Use your format conversion software to create new copies of this set of tracks from your .wav originals, replacing the 160k .mp3 files with the new copies in the current folder.


(4) Run the ExportImport script in Import Mode by dragging the file generated at step (2) onto the script.


(5) Select the contents of the playlist with Ctrl+A and run the ConsolidateByMoving script.



(6) Edit the destination folder if needed. This should be the folder that contains the Music folder you referred to earlier as the script should add in a \Music\ layer to the paths. Here you can see that the path in the test library I'm using is called D:\iTunes Blank\iTunes Media.



(7) When the script completes its work the tracks have been moved into correct artist and album folders, and the emptied Big Bucket folder has been removed.



(8) You can then right-click the selection in the playlist and use Remove from Playlist to set things up ready for the next folder that you're going to upgrade then rearrange.


tt2



Sep 18, 2020 10:11 AM in response to turingtest2

I had something come up so I'm just now going to start on this. That said, I'm trying to decide which file type I should use. I have probably 10 iPods or more, some as much as 256GB (rebuilt with SSD drives) so space could be an issue. I'm also looking at getting a new amp in the media room and one in particular doesn't play AIFF files. And I am concerned about how widely accepted they are. But I do want as good quality as I can. I know AAC lossless has file sizes comparable to MP3, but then that's not as high of quality. I can't use FLAC since iTunes won't read those. So I'm kind of stuck as to which direction to go. If I keep the file size down using AAC (or even MP3) then I don't have to worry about the music fitting on iPods. The Plex network is not an issue as you know as it's just playing off my server.


Most of my listening is done via Sonos on various speakers/zones or with headphones and an iPod. I do like the iPods with the Wolfson DAC (5th gen). I'd like to listen to more music in my theater room (I don't presently) and will use Plex (or Sonos with the Plex app) so the higher ALAC would be helpful.


Do you have any thoughts? I have a couple of the 256GB rebuilt iPods, many 160GB, and a variety of others in smaller GB sizes. It's a significant decision as I need to decide which way to go before I start this whole conversion task. Thanks!

Sep 18, 2020 12:04 PM in response to William Richards3

Apple Lossless (ALAC) is the same quality as .wav, smaller than .wav or .aiff, and has better tagging support. If ALAC works everywhere else you want to use your tracks then I would use ALAC. You could even potentially retire the .wav originals once you've converted everything to ALAC. Alternatively convert to say 320k MP3 or AAC depending on which works best with your other hardware and software.


tt2

Sep 18, 2020 12:15 PM in response to turingtest2

Okay, I finished testing a small sample of songs from a folder. It WORKED!


And then the albums for each artist:



AWESOME!! The only thing I noticed is that the original song file (Artist/Title) has been renamed, missing the Artist:


Do you know why that happened? It's also showing that way now in iTunes:



I'm concerned in future possibilities where I might be searching for the artist/title and it only shows "Angel" (the name of this particular Aerosmith song). Is there anything that can be done to keep the artist/title on the actual song file?

 

I used Media Monkey to convert the .wav to Lossless. You see that it should (and did) keep artist/title:


, I'm not sure why that didn't make it to the folder and iTunes per captures above. Also, you can see that I had a folder on the E drive called "Music". So I just put that link in the box that came up when I ran the consolidated by moving script. E:/Music. Then it added a second "Music" so now I would have Music\Music and that's not what I want. But I'm not sure how I would name it since if I just type "E:\" I'm not sure what folder name it would create.

 

I also didn't test this with the Lyrics tab. That should still work with your last version of EI script, right?


After your feedback to my question above, then I think the next step is to get rid of all that artwork, desktop.ini type of files sitting in a bunch of these folders. At that point, I'm on my way finally I think!

 

Please let me know. This is SO amazing. Thanks!

Sep 18, 2020 1:02 PM in response to turingtest2

YOU SAID: If you want to maintain your existing filename pattern then use the script CustomRenamer and specify the pattern as: <Artist>\<Album>\<Artist> - <Name>


ME: So I would do that AFTER I put everything in these folders - meaning, work through upgrading all the audio? Or should I use that script at some point in this process/flow as instructed to this point?


And could you let me know on this last question posted a short time ago?


Oh, one more question; Now that I have Aerosmith as an Artist using this script (shown in the captures I just sent, now on the E:\MUSIC\Music drive, what happens when Aerosmith (or other artists already in the list) comes up again? Will the script know to just use the one already there and then add songs to any respective albums already there - if you follow? So let's say that "Pump" album has one song from this initial script run test I just did. If the next folder I do this with has two more songs from Pump, will it just add those to the Artist/Album already showing in the list?


Will it ask me if I want to copy and replace or anything like that? If it wouldn't work like my question above poses, I'm not sure what I'd do.


And yes, it does sound like it. I'll try your other suggestions for the other scripts. As it stands now, it should be fine.


Oh - did you have a thought on the file type? I know we've exchanged on this before. I'd use the AIFF or ALAC except for file size concerns related to the iPods. I still use a lot. I'm trying to wonder how many songs of these file types I could fit on a 160 or 256. Thanks!!


This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

iTunes metadata and artwork

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.