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 5, 2020 10:41 AM in response to William Richards3

(I had to break this up, sorry)


So please let me

know what perhaps I'm doing wrong.  I'm quite certain I'm following the

steps but again:


1.     Highlight the song in iTunes

2.     Run the EI script.

3.     It saves the .txt file in the same folder the script is in and also makes an album artwork jpg.

4.     I then move out the 160 song version.

5.     I copy/move the new Lossless into the same folder the 160 was in.

6.     I then drag & drop the .txt file onto the EI script once again.

7.     It runs and I click the three different screens that come up in order, left-to-right:So please let me know what perhaps I'm doing wrong.  I'm quite certain I'm following the steps but again:



I then check iTunes and all is showing right and the songs are playing correctly. So I'm not sure why the data is missing from Windows and the ID3 tagging program as shown above.


Thoughts?


Side note: I wish there was a quicker way to build my new Artist/Album structure but I'm going to have to type the artist and then each album one-by-one unless you know of a faster way I'm not thinking about. 


Thanks!

 

Sep 5, 2020 11:47 AM in response to William Richards3

Responding to the most recent post first. In the first image untick the check box so you don't have to deal with this prompt every time.


What are you using for format conversion, and what build of iTunes are you running? Only 3 properties updated on import seems a little light, and clearly you're not getting back properties that should have been saved and then restored. I think I might have to replicate your environment more accurately here to see where things fall down. There is probably a way to force properties to be updated if the script isn't spotting that they're different when comparing current values and those in the text file.


I can show you how to safely move content from its current location to a new one at a later point, using either iTunes or custom tools to move/copy files and link iTunes to the new path so no information is lost. Let's focus on the upsampling project for now.


tt2

Sep 5, 2020 11:53 AM in response to William Richards3

As an experiment you could try running UpdateTagInfo with that Ace Of Base track selected, which might make the fields that show as empty in Explorer show as empty in iTunes too, then import the related text file again with ExportImport which should then restore the missing values. If that helps I can fold in the relevant code from one script into the other.


tt2

Nov 13, 2020 1:23 PM in response to turingtest2

Just an update to say I tried this again today. I tried doing the Export/Import on an album/songs that I'd never touched before. Meaning that no other attempts using this script have been done prior to the flow outlined below. I followed the flow I am supposed to and it still throws and error. It seems it's something to do with line 703? I have bolded that line.


If NewFile Or T.Name<>Value Then ' Don't update if value won't change

If NewFile Then T.Name=Value & "*" ' Force iTunes to update tag

Trace T,Change("Name",T.Name,Value)

T.Name=Value

U=U+1

Else

V=V+1

End If

Case "<played>"


And this is the error I just got when trying this today.


I am 99.99% sure I'm doing what I'm supposed to.


  1. I make a playlist and then drag the songs from Windows folder that I'm going to upgrade to lossless.
  2. I then run the E/I script 1.0.0.23. This creates a .txt file.
  3. Then I move out the songs from the Windows folder (160 baud) to a different folder (though still on the same hard-drive)
  4. Then I move the higher quality songs into that folder, replacing the 160 songs that were moved out. I do copy/paste from where the were. (I've tried moving them into the folder where 160 songs were but it doesn't matter).
  5. I then take the .txt file and drag it over and drop onto the E/I 1.0.0.23 script


That's when the error occurs so I'm not getting to the next step which would be the customer renamer to move to the new Hard-drive I'm putting everything onto.


(I've tried version .21, .22, and .24 as well without success) (NOTE: It seems that version 1.0.0.17 works well - except it's missing ratings and cover art I believe, which subsequent E/I scripts addressed. So something is happening to keep this from working now versus version .17 (sans missing artwork/ratings metadata I believe). (NOTE: I also think .23 handles a few songs at a time okay maybe(?) but has trouble with many tracks at a time (I'm doing about 15-18 at the moment - not large batches).


So can you figure out what's wrong? Am I missing a step or in the wrong order? As before, this is now stunting my progress for doing the project and finishing this massive undertaking. I'm praying that you'll be able to figure this out. Please let me know. I'm standing by.


Thanks!

Aug 31, 2020 10:45 AM in response to William Richards3

I tested my thought. I exported the entire library. Then opened in Excel. Then sorted the "100's" folder location and saved that as its own file in .txt. I then imported that into iTunes so only songs in the MP3-100's folder was in this file. It worked. So I could just save a separate file in excel for each folder and import one by one as I replace large chunks of files I think. It worked for the one I tried, so it seems it would work with others.



My thinking is that I could run your script for artwork. Then go into the 100s MP3 folder in this example and move all the songs out. Then move the new higher quality files in the same folder they were in. Then run your script again.


It seems that this would work? I would think if I proved yesterday that one-at-a-time worked, wouldn't all the songs in a folder respond in the same manner?


One challenge remained when I imported this excel 100 .txt file: Songs with a comma weren't imported. We exchanged on that quite a while ago. You'd suggested this:


It may help to surround the path in quotes or replace the commas with some valid alternative such as an escape sequence or code like &#44;


I'm not sure I understand that - but any changing of the file name would mean iTunes wouldn't know where to find it?

Perhaps time has given you a chance to have a solution for this?


I also need to run your DateArranger script to change that yyyy-mm-dd. I've archived your last version of this script I believe. I just got busy with things and never did it.


So once I get all the songs into iTunes with higher quality versions, I'm then going to start making proper Artist/Album structure and all songs will reside in that one folder, not scattered all over. That will take work, but the first thing is to get the metadata into these new quality versions. I'm leaning towards AIFF files as Apple supports that. Maybe MP3 320, or AAC. Nonetheless, that's the plan.

Nov 16, 2020 11:07 AM in response to turingtest2

Hello kind sir. I didn't do any work the past few days. But I changed the sequence of what I was doing, but it didn't work fully either. Let me explain.


  1. For some reason, I had it in my head that I needed to create a playlist, then drag the songs over from windows I wanted to change our fidelity quality (160 baud for lossless) into the playlist. That has not worked.
  2. So today, I thought I would just use the Export/Import script and not worry about creating a playlist. So I highlighted the 10 songs from a Paul Simon album. I did the usual sequence (highlighted the songs, ran the E/I script - 1.0.0.23, and it gave me the .txt file. I then moved the 160 baud songs out of the folder they were in. I copied in the new lossless version. I dragged the .txt file onto the script (1.0.0.23) and it worked, but eventually threw the error I've been getting. I did see that it worked for some of the 10 songs but not all of them. They were all in the same folder as the 160's were so I'm still stuck as I've been now for over 5 weeks.


You can see here that some of the 160 weren't modified, while others were. I have no clue why this isn't working.




The 1.0.0.17 script works fine - BUT it doesn't hold artwork or ratings I believe (which is why you continued to tweak it). At this juncture, unless I hopefully hear from you, I either need to go back to the .17 version and then manually update tons of songs, or just give up and figure out a different approach.


I am getting frustrated as I've been at the juncture where all artwork was manually added by hand, the pruning of all the songs has been done, ratings have all been updated for those that didn't have, and many more things I've been working on to now get me to this point. But as I said, I'm stuck unless, or until you can hopefully tell me what I'm doing wrong, or what happened between .17 version and the later versions you tweaked.


Your help has been just incredible and I'm thankful you've helped be greatly to get this far. All I need now is this script fixed, or correct the flow I'm maybe doing wrong.


I stand by hoping to hear from you soon. I really REALLY appreciate all you've done and sincerely pray to hear back quickly. If not, consider this a big huge thank you to get this far.


As always, I deeply appreciate everything you've done. Thanks!

Dec 20, 2020 6:43 PM in response to William Richards3

A couple more quick thoughts/replies.


YOU SAID:


I'd need a specific example of the before and after path for a track that needed to be located individually to work out why, and hopefully improve that mechanism.


ME: Sorry that I didn't reply directly perhaps in my responses yesterday. Here's an example and the structure:


"I" drive. Then Windows Explorer / MP3 - Masters / Albums January 2016 and beyond / Beatles - Hey Jude.mp3. (And dozens ormant dozens of other songs of varying artists/titles).


  1. I highlight those songs in iTunes. Run Export/Import which is located on the " D " drive under My. Documents / my computer tips and tricks/ iTunes Export/Import scripts. It creates a .txt file. (I've used a stand-alone folder where there's only the one E/I script but it never seems to matter).
  2. I move the .MP3 songs out of the "Albums 2016 and beyond" folder to another folder (but still within the MP3 - Masters main folder structure). Meaning, I'm not moving those songs to a totally different drive. (Should I? I don't recall any specific instructions to do that).
  3. I move the new .M4A tracks into that same "Albums 2016 and beyond" folder (I've done copy and paste, as well as dragging into the folder - it doesn't seem to matter)
  4. While still highlighting the songs, I drag the .txt into the 1.0.0.17 export/import script.


It will usually lose a large number of songs and show an exclamation next to many - or sometimes every single one. And when I click to play, iTunes asks if I want to find the song. I do - but it always browses to some other folder, making the process massively tedious as I'm forced to do it song-by-song, and then browse folder to folder to folder for each and every song. Not very productive.


So the "before" is the drive letter " I ". The "after" drive I end up moving to using customRenamer is the " O " drive. (That script works great).


I hope that answers your question. As stated yesterday, the .17 script is the most recent to work. I really hope you can figure this out.


And btw, when you test on your end, make sure you're testing at least 30-40 songs or better. If I do one song, that's not a problem.


I dont know if perhaps i need the songs in iTunes sorted by artist/title and then have that match the way it's sorted in Windows Explorer but that doesn't seem to matter.


Really really hope to hear back from you very soon. Cheers!

Aug 30, 2020 8:05 PM in response to William Richards3

William Richards3 wrote:

I ran out of room to post, but did want to thank you for sending our exchange on the DateArranger script you modified for me, and the related conversation. I'll review that again as well. Much work ahead of me, that's for sure. I don't know what I'd do if you weren't there - you've been so amazingly helpful. Truly.
Thanks again!


Yep, I ran out of room too, hence the two posts in reply.


Can you clarify what you currently have for an album that needs updating in your library? I'm assuming you have both a wav original and a 160k aac/mp3 version you want to upgrade, Is the Billboard data attached to both copies or only the 160k versions? I assume from earlier that artwork, ratings, playcounts and playlist membership are likely to be attached to the low res copies. You also mentioned artwork, BPM, comments, composer, genre, and grouping as needing to be copied. Again I think some variation of my DeDuper script is going to be the best way to approach this task, but I want to make sure we're on the same wavelength regarding the upgrade process before I start trying to make changes to it.


tt2

Sep 1, 2020 9:36 AM in response to William Richards3

ExportImport runs in two modes. For export you select tracks in iTunes and run the script, it saves properties in an XML-like text file. For import you drag and drop an exported file onto the script and it reads the exported data and applies it to the corresponding files in the library. The script doesn't currently deal with artwork, but that is a potential addition I can make. The count of 37 properties tells you how many fields were exported. When used in import mode you're told how many fields were updated from their previous values.


tt2

Sep 1, 2020 10:18 AM in response to William Richards3

YOU SAID:

Expose music related fields in Windows Explorer and see what information is stored for the old files before you replace them, then what data is visible in Explorer immediately after you replace with the new conversions, then look once again after running the CreateFolderArtwork script. I think you'll see the data is restored after running the script, which is what you want, but that certainly isn't what the script was designed to do. I'm guessing that might also explain the issue with lyrics if these are only ever stored in the tags, and referenced on demand from there when needed. If that is the case then this accidental metadata preservation method wouldn't work.


It definitely saves the information. Here's two places showing the data as it is BEFORE running the CFA script:


You'll see the metadata, including artwork. And in iTunes this is all showing as well as the original 160 file.

Sep 3, 2020 5:49 PM in response to William Richards3

Within any given folder filenames are unique. Windows Media Player would create Folder.jpg images in music folders. You may also see large and small thumbnails for each different album represented in a folder if WMP has been involved at some point, sometimes multiple images with different GUIDs (globally unique identifiers) for the same album. Likewise if you've run the CreateFolderArt script it will have created many Folder.jpg images, and if tracks from multiple albums are stored in the same folder then that image is only going to be representative of one of the albums.


iTunes doesn't generate any artwork in the music folders, but it has a separate artwork cache using a custom layout and image format. iTunes may associate downloaded artwork with a track without embedding it in the tag. If/when you let iTunes rearrange files and folders (the Keep organized option) iTunes will ignore any images and leave them behind when moving things around. Third party software such as Plex should be able to read embedded art, but not iTunes downloaded art, which might explain some of the discrepancies. Plex also has its own tools for grabbing metadata, although I'm more familiar with seeing what it does with movies.


I can offer another tool for cleaning up unwanted folder images, but let's work on one problem at a time. We're currently on reliably upsampling your mp3 files without losing any metadata in iTunes. I'm also going to work on allowing you to change format as part of that process. iTunes already has a feature that lets you selectively consolidate files into its standard layout, or I have another script that allows you more control with longer file and folder names than iTunes uses (40 char max.), better character substitution for those that cannot be used in a file path (iTunes uses _ for all of them), a custom layout based on file properties, etc.


tt2

Sep 4, 2020 5:33 PM in response to William Richards3

William Richards3 wrote:

Do you mean dropping it onto the actual .vbs file?


Yes. In Windows Explorer you should be able to see the ExportImport.vbs script and the file you exported at step 2 in the same folder. The exported .txt files and artwork images are generated in the same folder as the script, you don't have any options here.


Use the mouse to select the .txt file, drag it over the top of the ExportImport.vbs file and let go of the mouse button, i.e. drop. This is a universal command that tells Windows to open the dragged file with the dropped file.




Note that no properties are updated in this demonstration because I'm using the same file that I'd imported earlier. If you import the same file twice in a row (without making any changes to the metadata of that track in iTunes first) then there shouldn't be any need to update any values.


Note too the artwork image in the same folder as the script and the exported text file. This was created during the export phase and is what will be used during import to add artwork to the new copy of the track. Each export creates a new output file. Once you've imported that file you don't need to keep it or the artwork images that were created.


tt2

Sep 16, 2020 2:57 AM in response to William Richards3

Hi,


There are two ways you can deal with the unwanted artwork. You can use Windows Explorer's search tools to search for all files of the following forms on your drive in turn, then select and delete the results:


AlbumArt*.*

Desktop.ini

Thumbs.db

.DS_Store

._


You might optionally want to remove Folder.jpg images too since, in your case, any such images are likely associated with one album in a folder that contains tracks from many.


Or you can use my script to gather the same content into a new folder, e.g. X:\Artwork where X: is the drive your library is on, so that you can review what has been pulled out before you delete it. In its current form it leaves Folder.jpg files behind. I could add an option to remove those too if you want.


If you've already downloaded a copy of CleanDeadArt and want to use it then download a fresh copy as it got a minor bug fix last night. This is the output I got running it against my iTunes library. I had a lot of old <GUID> art I'd not previously got around to cleaning out.



To my surprise that's only about 100MB of data, so no real saving, but still nice to have a clean up.


tt2

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

William Richards3 wrote:

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:


iTunes, Windows Media Player, any many other media managers default to the <Artist>\<Album>\## <Name>.<Ext> layout. When you look inside an album folder you already know the artist from the parent folders. Using the leading track numbers means the tracks are listed in track number order and don't contain redundant data you have to ignore to read the track name.


If you want to maintain your existing filename pattern then use the script CustomRenamer and specify the pattern as:

<Artist>\<Album>\<Artist> - <Name>


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'd be surprised if it is ever really an issue. I don't have any trouble locating content in my library, either by drilling down through the folders, or searching in iTunes, and then showing in Explorer if I want to access the file. For playback it really doesn't matter where things are, or what they are called. As above, use a different script to give you fine control over the filename when moved into artist and album folders.  


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


That is because you're telling MediaMonkey to use the <Artist> - < Title> pattern for its output. It will use whatever form you tell it to.


, I'm not sure why that didn't make it to the folder and iTunes per captures above.


Because ConsolidateByMoving is designed to use a different filename pattern. Use CustomRenamer instead.


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.


With ConsolidateByMoving you would use E:\ as the media folder. With CustomRenamer I think you would either use E:\Music or use E: and set the pattern to Music\<Artist>\<Album>\<Artist> - <Name>. You can test it out for best results. You can also edit CustomRenamer so that it knows your default media folder and pattern so that you don't have to edit those each time you use it.

 

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


Yes. But test it again before you start processing tracks in volume just to be sure.


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!


Sounds like you're getting there.


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.