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 29, 2020 2:32 PM in response to turingtest2

One more thing today, sorry. I went back over all our exchanges and I'm not seeing this specifically stated (I likely missed) and I just want to confirm. For using the Custom Renamer script, I do everything I would do with Consolidate By Moving script, only the CR script will make the Artist/Album and the song file I want, which is Artist - Title, right?


Thanks!

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

William Richards3 wrote:

One more thing today, sorry. I went back over all our exchanges and I'm not seeing this specifically stated (I likely missed) and I just want to confirm. For using the Custom Renamer script, I do everything I would do with Consolidate By Moving script, only the CR script will make the Artist/Album and the song file I want, which is Artist - Title, right?

Thanks!


Yes. This post back on page 10 is probably the most relevant. In particular I said (with some additional emphasis):




Given you want your files in <Artist> - <Name> form use CustomRenamer instead of ConsolidateByMoving. They are variations of the same script, but have different options for the precise layout of the files. CustomRenamer will support your naming scheme.


In CustomRenamer line 147 reads:

Root="" ' Preset target folder, set here to avoid second dialog


Change this to:

Root="E:\" ' Preset target folder, set here to avoid second dialog


so the script doesn't suggest the wrong media folder path. Likewise line 167 reads:

Pattern="Music\<AlbumArtist>\<Album>\<TrackNumber> <Name>"


Which you can change to:

Pattern="Music\<AlbumArtist>\<Album>\<AlbumArtist> <Name>"


so that you get the filenames the way that you want them.




Saving the script with these changes cuts down the work you need to do each time you run the script and helps eliminate errors caused by typos. If I've not mentioned it before I recommend using Notepad++ for editing as it does some nice syntax highlighting and shows line numbers. I've used <AlbumArtist> above, because this trumps artist if both are set, and if album artist is blank it will use artist if available, otherwise default to Unknown Artist, mirroring the behaviour of iTunes itself.


tt2

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

William Richards3 wrote:

YOU SAID: I added a feature in ExportImport to ensure that artwork gets embedded. iTunes and Windows Explorer should both show art after using it to upsample a track.

ME: Would this also work as pointed out above - for songs that maintain original fidelity but are moved to new Drive?


CustomRenamer won't embed artwork. If you have tracks that have iTunes artwork that doesn't show in Windows Explorer, and aren't .wav files, try using EmbediTunesArt.


tt2

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

William Richards3 wrote:

I've seen that but never used that before because I wanted to keep the .wav files I can move to iPod(s) with plenty of memory for the remaining MP3s at this point. So I think it would also convert the .wav. But since the Lossless is the same fidelity as wav I believe you said, maybe that would be okay. The real question is this: It doesn't change the files themselves in iTunes, right? It only does it as I'm syncing to a particular iPod, right?


Correct. The original in the library is left as is, and a downsampled version is made on the fly to put on the device. This avoids the headache of multiple libraries, at least if you're only working with iTunes and iPods. Obviously if you're supporting other hardware and software (as I think you are) then you probably want to continue with your current project of making a better quality but still partly compressed library.


tt2

Sep 30, 2020 9:16 AM in response to turingtest2

YOU SAID: CustomRenamer won't embed artwork. If you have tracks that have iTunes artwork that doesn't show in Windows Explorer, and aren't .wav files, try using EmbediTunesArt.


ME: Will the EmbediTunesArt follow the same flow as CustomRenamer and ConsolidateByMoving? I'd asked you to confirm that CR worked the same as CBM except that CR lets me set the song as "Artist - Title" which is what I want. Does this Embed script follow that same pattern or is there another use for this script? Meaning, do I run CR first for example, and then the Embed? Or just use Embed instead?

Sep 30, 2020 9:41 AM in response to William Richards3

William Richards3 wrote:

YOU SAID: CustomRenamer won't embed artwork. If you have tracks that have iTunes artwork that doesn't show in Windows Explorer, and aren't .wav files, try using EmbediTunesArt.

ME: Will the EmbediTunesArt follow the same flow as CustomRenamer and ConsolidateByMoving? I'd asked you to confirm that CR worked the same as CBM except that CR lets me set the song as "Artist - Title" which is what I want. Does this Embed script follow that same pattern or is there another use for this script? Meaning, do I run CR first for example, and then the Embed? Or just use Embed instead?


The scripts are independent and do different jobs. You can run in either order or not all all. If you want to relocate some tracks from where they are now to where you want them to be in future use CustomRenamer. If you want to embed iTunes Store downloaded artwork use EmbediTunesArt. As with the bulk of my scripts the method of use for both of these is to select some content in iTunes you want to update, the double-click on the script in Windows Explorer, and respond to any prompts.


tt2

Sep 30, 2020 10:43 AM in response to turingtest2

YOU SAID: The original in the library is left as is, and a downsampled version is made on the fly to put on the device. This avoids the headache of multiple libraries, at least if you're only working with iTunes and iPods.


ME: I have some core artists which I want to have their .wav files on my iPods. If I use the downsampled process - Converting on the fly when syncing to iPod - I can't determine which files get downsampled I wouldn't image. Most files are between 160-320 but as I said, some core artists are .wav. I wish there were a way to determine those. But once I get the library converted over to lossless, then all the songs would be the same (except for those that stay in their original 128, 160 or whatever mp3 version I have without a .wav version to upgrade).


But this is good to know as I don't have to worry about them fitting on iPods. As much as I know, there's so much I don't know. And google is so hard sometimes because you get such conflicting input.

Sep 30, 2020 1:54 PM in response to turingtest2

YOU SAID: The scripts are independent and do different jobs. You can run in either order or not all all. If you want to relocate some tracks from where they are now to where you want them to be in future use CustomRenamer. If you want to embed iTunes Store downloaded artwork use EmbediTunesArt. As with the bulk of my scripts the method of use for both of these is to select some content in iTunes you want to update, the double-click on the script in Windows Explorer, and respond to any prompts.


ME: Should I run Embed script after I do all the upgraded audio tracks? Or doesn't it matter? I could run the Embed first I suppose. Make sure it works for me.


I have another question related to redoing this library. Did I miss a reply when I asked you this? I was asking about songs I didn't have .wav to upgrade to. Do I use the same CustomRenamer process where I create an empty playlist and drag songs into it and run Export/Import and the rest of the flow?


In other words, during the CustomRenamer flow, I am moving or deleting the original 160 files and putting the newly

converted ones into the folder the originals were in. But if I have no .wav to use to upgrade the quality...., or if I only have the song as an iTunes purchase, or got the file from a friend and it's the only version/quality I have, what do I do in that case? I want to move these - or make them part of the new MUSIC Drive I'll have all these files on so that the naming structure

is helped along (so I don't have to create artist/album for each file). So I'm just wondering how that would work?


Sep 30, 2020 2:12 PM in response to William Richards3

William Richards3 wrote:

I have another question related to redoing this library. Did I miss a reply when I asked you this? I was asking about songs I didn't have .wav to upgrade to. Do I use the same CustomRenamer process where I create an empty playlist and drag songs into it and run Export/Import and the rest of the flow?


You only need to use ExportImport when upsampling tracks by exporting metadata (in export mode) and then replacing the files with tracks of the same name but a different extension in the same folder and running the script in import mode. It doesn't actually matter where the files are when you do this, so you could do it before moving or afterwards, but I think the structure of your .wav originals makes it easier for you to do this first. For files that you're not going to upsample you don't need to run ExportImport at all.


In other words, during the CustomRenamer flow, I am moving or deleting the original 160 files and putting the newly
converted ones into the folder the originals were in. But if I have no .wav to use to upgrade the quality...., or if I only have the song as an iTunes purchase, or got the file from a friend and it's the only version/quality I have, what do I do in that case? I want to move these - or make them part of the new MUSIC Drive I'll have all these files on so that the naming structure is helped along (so I don't have to create artist/album for each file). So I'm just wondering how that would work?


Just run CustomRenamer with a selection of tracks that don't need upsampling and it will move them to the new paths, creating the folders as necessary, naming the files according to your preference, relinking the library to the moved tracks, and, if appropriate, cleaning up any folders that become empty after the contents are moved.


tt2

Sep 30, 2020 2:54 PM in response to turingtest2

YOU SAID: You only need to use ExportImport when upsampling tracks by exporting metadata (in export mode) and then replacing the files with tracks of the same name but a different extension in the same folder and running the script in import mode. It doesn't actually matter where the files are when you do this, so you could do it before moving or afterwards, but I think the structure of your .wav originals makes it easier for you to do this first. For files that you're not going to upsample you don't need to run ExportImport at all.


ME: I'm sorry, I'm not sure I'm clear on this as it sounds a bit confusing to me. Are you saying I would have to change the file extension of the original file (that I have no ability to upsample)? I don't think that's what you mean of course. So if I'm not upgrading the fidelity, I wouldn't use Export/Import? Is that what you're saying? Sorry, perhaps you can state this a different way or show me an example of the flow like you've done with other elements?


YOU SAID: Just run CustomRenamer with a selection of tracks that don't need upsampling and it will move them to the new paths, creating the folders as necessary, naming the files according to your preference, relinking the library to the moved tracks, and, if appropriate, cleaning up any folders that become empty after the contents are moved.


ME: I believe for files where I don't have any ability to upgrade from their current quality, I should just run CustomRenamer. Would that be a right conclusion? I still would make a playlist for those and then run the CR script, right? And your two comments and my two responses in this specific exchange, is also a little confusing to me. So sorry.


Sep 30, 2020 3:01 PM in response to turingtest2

I did the flow of the custom renamer. This is what the song looks like. This is the upsampled quality and is in a new location.


And yes, I created a playlist. I dragged the 160 version to that playlist. I ran the E/I script. I then moved it out and put the upsampled version in its place. I dragged the .txt file onto the E/I script and it executed. Then ran the CustomRenamer script. I changed the Drive letter and put the Artist/Album/Artist - Name (using the proper formatting) < >.....


The entire library that iTunes looks for is all on the "I" drive presently. I will be moving/enhancing/rebuilding to have everything be in the folder structure of just Artist/Album that your CRenamer script does. You'll notice the song is now 320 baud. The original is 160. I only did one song this time,


Is that what you were asking?

Sep 30, 2020 3:26 PM in response to William Richards3

William Richards3 wrote:

YOU SAID: You only need to use ExportImport when upsampling tracks by exporting metadata (in export mode) and then replacing the files with tracks of the same name but a different extension in the same folder and running the script in import mode. It doesn't actually matter where the files are when you do this, so you could do it before moving or afterwards, but I think the structure of your .wav originals makes it easier for you to do this first. For files that you're not going to upsample you don't need to run ExportImport at all.

ME: I'm sorry, I'm not sure I'm clear on this as it sounds a bit confusing to me. Are you saying I would have to change the file extension of the original file (that I have no ability to upsample)? I don't think that's what you mean of course. So if I'm not upgrading the fidelity, I wouldn't use Export/Import? Is that what you're saying? Sorry, perhaps you can state this a different way or show me an example of the flow like you've done with other elements?


My fault, that's me getting confused over what we've discussed and what options I've buried in the script. There is an option in the script (currently line 142 in the copy I'm about to upload) that reads:


Force=False ' Force all properties to be updated during import


Which needs to be set to Force=True for you as you're upgrading from 160 mp3 to 320 mp3. If you were upgrading to Apple Lossless, for example, then the script detects that the file has been replaced and therefore knows that there is a new file and each property needs to be explicitly updated by setting a new value and then the value that is actually wanted. In the context the script was originally written for, exporting data from an old library file, then importing that data into a newer one, it shouldn't be necessary to write the wrong values before the right ones, which is why the default setting of this switch is false.


tt2

Sep 30, 2020 3:29 PM in response to William Richards3

William Richards3 wrote:

YOU SAID: Just run CustomRenamer with a selection of tracks that don't need upsampling and it will move them to the new paths, creating the folders as necessary, naming the files according to your preference, relinking the library to the moved tracks, and, if appropriate, cleaning up any folders that become empty after the contents are moved.

ME: I believe for files where I don't have any ability to upgrade from their current quality, I should just run CustomRenamer. Would that be a right conclusion? I still would make a playlist for those and then run the CR script, right? And your two comments and my two responses in this specific exchange, is also a little confusing to me. So sorry.


Yes, just run CustomRenamer with the files selected that you want to move. You don't have to make playlists first. You only need do that if it helps you organize a selection of content that you might want to process in a number of stages or sections.


tt2

Sep 30, 2020 3:56 PM in response to turingtest2

When I was testing things and upgraded the 160 with mp3, the album title was showing, just look at the capture for Aerosmith - Angel.mp3 above in my last couple of postings. So I don't know if that (needs to be Apple lossless) is the issue. I could test with another track and try again and see what I get. So this script update will affect what? Is this a new CustomRenamer script?

Would it help if I copied the order I followed when I was doing the test today?


Based on knowing about the ability for iTunes to downsample when hooking up the iPod, that gives me calm in not using AAC or MP3 320 necessarily. Would the script work for any of the types (MP3 or lossless?)

Sep 30, 2020 4:10 PM in response to turingtest2

turingtest2 wrote:

There is an option in the script (currently line 142 in the copy I'm about to upload) that reads:

Force=False ' Force all properties to be updated during import

Which needs to be set to Force=True for you as you're upgrading from 160 mp3 to 320 mp3. If you were upgrading to Apple Lossless, for example, then the script detects that the file has been replaced and therefore knows that there is a new file and each property needs to be explicitly updated by setting a new value and then the value that is actually wanted. In the context the script was originally written for, exporting data from an old library file, then importing that data into a newer one, it shouldn't be necessary to write the wrong values before the right ones, which is why the default setting of this switch is false.

tt2


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.


Nothing has changed with CustomRenamer. You don't need to change your workflow from 320k mp3, the process we're building should work, or can be licked into submission if it still isn't quite right.


tt2

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.