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 24, 2020 3:32 PM in response to William Richards3

The one property that gets updated every time is album artwork, since iTunes doesn't seem to be capable of reliably telling us if there is downloaded or embedded artwork after you've supplied an upsampled file. There is probably a bit of optimisation so it only happens with upsampling or when another flag is set, but I don't think it is a major issue right now.


I'm not sure why your exported data file is missing the Description values that you want to be imported, but I'm guessing they're not there or they would be added. You can edit the text file and add the descriptions to it, then use ExportImport to apply them. It may be easier to simply insert the values you want in the Songs layout of the library where you should be able to click twice in the Description field to start editing it.


tt2

Sep 29, 2020 6:28 PM in response to William Richards3

William Richards3 wrote:

I used Export/Import on them (burning a new version from the original .wav) but it didn't change the outcome. Even though the 160 was moved out and the 320 moved in, and the script ran as instructed, it still ended before it was supposed to.


Select a song that stops earlier than it should, press Ctrl+i to get Song Info. Select the Options tab, then delete the stop time and click OK. This should reset the stop time to the full duration of the song.



Stop time is one of the properties saved and restored by ExportImport, so if the current stop time is wrong, then it will be wrong with a newly upsampled file when its metadata has been restored using ExportImport. I cannot think of any other good explanation for why a fresh conversion of a .wav file that plays fully, and whose conversion plays fully in other software, would play short in iTunes other than due to a stop time which is shorter than the duration.


tt2

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

William Richards3 wrote:

YOU SAID: I've uploaded a new version of ExportImport that no longer adds multiple images in certain circumstances. I've also saved this version with Force=True so there is no need for you to edit it before use,

ME: So it will still work no matter the file type, right? What does Force=True do instead of Force=False? You explained it but I don't think I'm totally grasping that.

Cheers!!


Yes, it should work whatever the file type. Originally the script was designed for a situation where the values being read in were different from what iTunes currently knows for some fields, so if the values are different they would get updated. In your case iTunes knows the correct value, but it is missing from the tag. If the album is Jagged Little Pill and the script tells iTunes:


Track.Album="Jagged Little Pill"


it doesn't do anything. An extra step is needed to force the creation/update of the tag, e.g.:


Track.Album="Jagged Little Pill*"

Track.Album="Jagged Little Pill"


which is what is achieved by setting Force=True, and also happens automatically if the file type has changed between export and import. Text values get an extra * added and then removed, numeric values get 1 added and then taken away, and logical values are inverted and then restored.


tt2



Oct 2, 2020 3:33 AM in response to William Richards3

William Richards3 wrote:

I ran the CleanDeadArt (custom update you did on 9/16). That worked fine.

I then tried the EmbediTunesArt script. It "almost" worked. I selected an artist with multiple albums. Most had some artwork, but not all. I used Get Album Artwork for titles missing artwork and did so for each album. I then ran the script. Most show up in Windows Explorer. But even trying multiple ones missing, or doing only one track, it just isn't coming through for all. I'm not understanding why most worked and showed up in Windows Explorer and some didn't. The artwork for all titles is showing in iTunes. Is it because some had artwork and itunes didn't quite know what was what when I ran Get Album Artwork? Here's how it looks now. And the tracks that show no artwork, actually had artwork on them, and still show artwork in iTunes.

Before I proceed to use that script for other folders as I now move to this area, I want to make sure I'm not doing something wrong.

Thanks as always!!!


Please look in the Artwork folder that has been created in whatever location you've stored the EmbediTunesArt script. Do see the appropriate images for the tracks that are missing artwork in Explorer? I.e. assuming the first track Acapulco Gold Filters is from the album Cheech & Chong (or Cheech and Chong) is there an image in the folder called Cheech & Chong - Cheech & Chong.jpg (or Cheech & Chong - Cheech and Chong.jpg). Is the album title set consistently for all tracks from the album? My personal convention is to use & over and in artist, album, and song names regardless of what is printed on sleeve notes, again aiming for a consistent look throughout the library.


See Repair security permissions for iTunes for Windows - Apple Community for possible reasons why iTunes, and by extension my scripts, might sometimes not be able to process a tag change.


Let me know what you see and if needs be I'll add in some debugging messages to see if the script is not finding an image to add, or is failing to add it when the time comes.


tt2

Aug 28, 2020 8:42 PM in response to turingtest2

Thank you so much for your kind reply. I could send you some of our exchange relative to what I'm attempting to do (and did last time). One thing that I lost track of was the exact order of how to execute the CreateFolderArt script you provided.

Would you mind if I pasted some of our discussion? As quickly and simply as I can, here is what I'm trying to accomplish:


  1. I use the iTunes info area to the best of my options. Grouping=Song peak position in the Billboard charts. Composer=Season (Winter, Spring, Summer of Fall), Comments=Chart peak date (e.g. 4/11/1989 - which is the date it hit the peak position on the chart) (You actually wrote a script so that my peak position would change to yyyy-mm-dd format). And of course I use Genre, album title, rating, and BPM as well. Also, I use mostly my own work at adding the album art to each title. (Now the chart peak date and chart position is not used on album tracks or things that aren't Top Hits (Top 40)).


So that's part of making sure that information gets carried over.


I should also add that my XML and ITL files are in the usual C:My Music/iTunes folder but most of my music resides on a larger 4TB hard-drive. (I do have some titles that are in the C: drive that I purchased off iTunes at one time or another but I own 99% of the music in my itunes). So maybe that's why the artwork and some of this gets funky. Also, I don't store my music in the normal fashion most do. For example, I have many folders of TM Discs (radio) such as 100, 200, 300 etc, and there can be upwards of over 1,000 songs in the 300,400,500 folder for example. So I don't have that many "Artist/Album/Title" sort of structure. That IS part of what I'm going to do here. I'm going go get these higher quality files to replace the old ones, then move everything to the proper structure - while keeping the playlists in tact if I can. (Any help/ideas here would be appreciated).


I am then going to change all the songs in the library that are currently 160 baud rate to be FLAC, AIFF or MP3/Lossless 320 baud. (Any suggestions on which to use? These will play through Apple Airplay or Sonos for example as I rebuild things.


So I'm looking for the best plan to copy over the existing file (160 baud) with this newer, higher-quality version and keep all the information intact (metadata, play counts, etc.) I would like to do this so I can use all the existing playlists I've made (I have hundreds of playlists).


Please let me know. As I mentioned last time on our exchange, I'd be happy to pay for your help if that's possible. Or a donation of some type?


Let me know if it would help to paste the previous conversations we had. I can tell you that the album art always seemed to fail, and the comments (chart peak date) and sometimes the composer would get lost.


I anxiously await your reply. BTW, the files I got from you before are: DateArranger (zeros version, which replaced the first DateArranger you provided), CreateFolderArt, and UpdateTagInfo. Those are archived from our previous exchanges.


Thank you so much. Stay safe!

Aug 31, 2020 7:49 AM in response to turingtest2

Let my try to explain this more succinctly as I've failed to do so I think. When I say I'm converting wav files stored in completely different folders - independent of anything related to iTunes - what I mean is that I'll use a third-party program to convert those wav files to either MP3 320, AAC, AIFF. Those newly converted files will then replace the 160 versions in iTunes. Any wav files I have in iTunes don't have any metadata as wav won't accept them. That is not a concern and I won't be using wav - in fact, any wav files I have will be replaced and would need to have metadata added to them at this point. That's a whole separate thing and not anything to do with the process of 99% of my library.


When I ran the script and said "Yes", it kept throwing an error. That's why I ended up saying No, and it worked. So I don't think I would ever say Yes in my situation would I?


On your ConvertFormat script, are you saying that would be run "after" the CreateFolderArt to try and have the lyrics remain? As I mentioned yesterday, I have probably 1% of the files with lyrics so it's not a big deal to not have them carry over.


On your last point above, the 300/400/500 folder (one of many folders for itunes music), there are 2,345 songs. There are many, many artists who have multiple songs in this folder, but likely from various albums. But probably 95% of the 2,345 songs have the album art. (Not all have Billboard chart data as they were not Top 40 songs - more just album tracks). There are only a small handful of folders that have the artist and album. Maybe 1% of the library is that way. I just didn't set up my system in itunes in this way. I never imagined it would come back to haunt me. It's why I'm redoing the whole thing so it's all set up that way. The problem is that - in iTunes - I can't highlight songs only from the 300/400/500 folder as there's no column that lists file location so I could sort on it. If I could, perhaps I could run your script all at once - assuming I converted all of the songs and was ready to replace as I did yesterday in my test example covered above.

Perhaps there's another approach as you suggest might be possible. Hopefully I've explained this.

Here's an example of my folder structure (just some of many folders):


Aug 31, 2020 9:27 AM in response to turingtest2

My session timed out and I lost all my replies to your post above. :(

Let me try to recompose.

I routinely back up my MyMusic iTunes folder where XML and related files are. I also export the Music library to excel on occasion, as well as any new playlists I make.

I found through my own trial and error that if you keep the same hard-drive number (e.g. "D") for where your music is stored and then copy your MyMusic stuff over to a new computer, it all comes back 100%. I've proven this several times so I'm not worried about losing my library.


As it relates to what I'm trying to do, if iTunes provided a way for me to sort by file location, it would make this a lot easier as I could simply move all, or some of those and then replace with the newer, higher quality songs. Otherwise, I'm going to have to do it one-at-a-time. There's simply no way to do it as if I sort by artist and album I don't think. Let me choose Abba artist for example. I have 11 songs. They are in 7 different folders. I'm not sure how this would be managed? Unless I just move everything out of all the folders for all the music and then paste them back with new versions as I go? Is that what you're suggesting?


"I googled and saw a forum where someone was trying to sort by file location as well. Here was their question:

hi, i was wonderin if i can set up my itunes sortin columns SORT BY LOCATION or FILE PATH(like windows media player), ive just started using itunes but all my songs are being organized by folder in different location. if someone can tell me how i can sort my songs by location it would be great!"


And here was the reply:

"Well, if you don't mind losing the "Description" information (most people don't use it...), I wrote a script that will set the

"Description" of each track in the playlist(s) you select to the file path. You then can just turn on the Description column in your iTunes view, and sort by that column."


There was no script file to download that I could find in that post (it was from 2008 in the same itunes forum as we're using).


Anyway, that sure seems to be the best solution in my opinion. Then I can just step through each folder location and move and replace songs. I could probably even do the whole lot of them at once.


I see you have replied to my first reply today, but let me post this and follow the thread properly below.

Thoughts?

Aug 31, 2020 9:43 AM in response to the fiend

I'm doing a horrific job of explaining. No, I'm not converting 160 to 320. Here is a folder (100) with the wav files - these are on a totally different hard-drive, completely un-associated with iTunes:


Now here is that same folder, but the MP3 versions on the hard-drive where iTunes sees them - and these play in itunes from this folder:


So I will convert the wav files to a higher quality file - and then replace this better version to replace the 160 files shown directly above.

And I proved yesterday that I can moved, then replace - and keep the metadata (sans the lyrics at this point) - the existing file. So it seems to me that if I could sort iTunes by location, that would be much easier. Here's the excel file after I exported it and then sorted by location. (Perhaps I could import back as a playlist and then use that playlist to accomplish the same thing?). Anyway, here's what I mean:


Thoughts?

Aug 31, 2020 12:58 PM in response to turingtest2

BTW, yes, the metadata is only on the 160, not the wav. The wav versions are not in iTunes. Those exist on a completely different hard-drive and folder and will be used as the file to convert from to the new higher quality version but will remain in their wav state for any future time I might want to convert from them. That's the good thing I did from day-one years ago is that I burned everything as wav and then converted to MP3 160 and those are what exist in iTunes now - not the wav versions. I'll continue to keep the wav in that state on the separate hard-drive for any future need. They'll be untouched.

Aug 31, 2020 1:15 PM in response to turingtest2

Let me reply. (I don't know how to break up your replies and reply at the spot where I should above. Maybe you can tell me how to do that.

I'm using your CreateFolderArtwork script to replace the song with higher quality. I run your script. Then I move the song out of the folder it's in. I then put the updated one in the same folder. I run your script again. All the metadata, including artwork is there. The only thing missing is the lyrics. I-Tunes is recognizing it right away.

I just tried saying Yes and tried to replicate the error message. I had it pasted in a Word document but didn't save it, thinking "why would I ever need this?" Well, now I guess I should have. It was like a broken link or something. This time it worked saying YES. It has the new 320 baud rate and all the metadata is there. So I guess that would be just a random thing that happened? So I should be saying Yes is what you're saying, right - when I run your script?

The script for keyword description looks like it would be what I need, and then I can sort on that column (I'll check the box so the column header shows up - it's currently unchecked). What's the description header for anyway? Videos I believe I saw?


And your last comment (saying it was interrupted?) was perhaps where I lost connection and had to re-login or something? Nonetheless, I think we're making good progress here.


Aug 31, 2020 1:54 PM in response to turingtest2

I have iTunes on a different computer (three different computers actually) so I can use one for testing purposes. I did your KeywordsToDescription script and entered Location and all it did was put that word on all the files. I then replaced the XML so it went back to previous status prior to running the script. Then I entered <Location> and it is going through the library putting their locations in as the capture shows. You can see it's filled out quite a number already (but not finished yet).


So if I can sort on that column, which I'm pretty sure I can - that would expedite my work tremendously as I should be able to replace the 160 versions with new quality en masse a folder at a time? I'm assuming your CreateFolderArtwork script works on hundreds and hundreds of songs in the same was it does on one-at-a-time doesn't it? If so, then you've just saved me days, into weeks of work. Man, I don't know how you know this stuff but it's brilliant.

Okay, it just finished. I was able to sort the column as I expected I could. Amazing! Anyway, let me know.


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.