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

Dec 9, 2020 8:57 PM in response to William Richards3

William Richards3 wrote:

I hope you had a nice Thanksgiving and that all is well.


Thanks. We don't celebrate this side of the pond, but I trust yours went well.


I've not yet heard back from you since your Nov 12th reply asking how things were moving along. I am trying to use this EmbedArtwork script and it seems to still throw an error - depending on the folder I'm running it against. In some cases, there are many files within the folder than I have deleted from iTunes so there would be no reference point in itunes for those songs. Not sure if that's causing the issue. I get either an error on line 155 - or a "catastrophic" error. In either case, I go to my smart playlist called Artwork Missing (you showed me how to set that up in smart playlist), so I can find those it deleted the artwork from and go back and add them back again. But I'm about to embark on doing hundreds of titles so it would be helpful to see what your input might be.


Line 155-7 is this little section, which is supposed to clean out store art before embedding custom art.


If .Artwork.Item(1).IsDownloadedArtwork Then

.Artwork.Item(1).Delete ' Then remove the store art

End If


If nothing else I can simply ignore any errors that occur although I'd prefer to understand what mistake I'm making here. Either way I'll see what I can do to make this code more robust.


On another subject, I tested just moving some songs that I am not replacing the fidelity on - meaning these songs were either purchased, or I got through other means (I don't have a CD, or the .wav to upgrade). That works fine with CustomRenamer script. However, there's a minor question that I'm not sure you know the answer to. When it puts it in the new HD location and it moves them to the new drive, the Artist/Album won't show in the left tree in Windows explorer. I have to click the actual artist folder on the right side to have it show up on the left as part of the rest of the folders in alphabetical order. Do you know why that would be the case? It is going to cause me to have to click thousands of artist/album folders once I start CustomRenamer on this library en masse. Any thoughts?


Windows Explorer may not refresh the folder tree if folder are added and removed by other processes, but if you close Explorer and then reopen it you should find that all the nested folders are present and correct.


I do hope to hear from you on these, and other posts since your last input. I'm not sure how this works but should I post a new forum (I did once a couple months back but didn't get any reply) if you're unable to provide further assistance? You've been amazing so I'm really hoping to hear back from you on this. If not, I'll thank you again for so much tremendous help prior.

Thanks so much. Anxiously and hopefully awaiting feedback.


I think I've responded to all the posts that I'd missed so far with this one. Clearly there is still some catching up to do but it is now way past my bedtime (5am!) so I'll call it a night for now.


tt2

Dec 18, 2020 2:40 PM in response to turingtest2

YOU SAID: (in reply to me)

ME: When I look, the script is still showing 1.0.0.1 and says it's the original version. So I'm not sure if the version posted (which I've downloaded again just to make sure) is an updated, correct version.



It is a new script, I start counting both major and minor version numbers at 1. There are four numbers because I copied the layout of the iTunes version number at the outset. I clearly don't need that many.


I just downloaded the EmbedArtwork from the scripts site and then did a compare versions from what I had a couple of months ago at least and it said the scripts match exactly. Both say version 1.0.0.1. so I'm unclear if I'm misunderstanding you, or if the updated script was not posted? Please let me know.

Dec 18, 2020 2:46 PM in response to turingtest2

YOU SAID: (in reply to me)

I have done several posts. Last you replied on October 8th, you were going to rework the code on CleanDeadArt.


I'm afraid I cannot work out which specific post you're referring to here, or what I might have been planning to do.


ME: This had to do with you telling me that I should be able to run this script on a hard-drive and have it go through all the folders instead of me going folder-by-folder as I had done before. You alerted me to that fact and suggested I just do it on the main folder and subsequent ones which would be under it and run the script. So for example, if might be the H:/Bill's computer / and then a bunch of folders from A-to-Z underneath in Windows. When I ran the script, it threw an error or something - where it wouldn't complete it. You said you would look into the code. That's what this was about. Not a major issue.

Dec 18, 2020 2:50 PM in response to turingtest2

YOU SAID: (in reply to me)

1. The biggest one has to do with the Export/Import and then CustomRenamer process. I actually had some success with this, but it's sporadic and today, coincidentally it didn't work again.


What didn't work? What tracks were you renaming, with what pattern? What did you expect to happen? What actually happened?


<Edit> Now that I've replied to more of this post I see you've mentioned an issue with ExportImport. I'm not sure CustomRenamer is even involved at this point.


ME: Yes, that would be correct. The CustomRenamer is working great. Especially since you showed me how to modify the script. In fact, I've also used the code script so I can make a folder "Soundtracks" and then the artist/album/title go under it as an example. Or for "Radio Plays" and have those all under that folder. That's correct. As for Export/Import, yes that is still my #1 issue by far. I'll post that next.

Dec 18, 2020 3:01 PM in response to turingtest2

YOU SAID:

In my version of ExportImport line 518 reads End If. It is an unlikely to cause an error. Visually the code appears to be balanced as far as Ifs and End Ifs goes. Is it the same in your version of the script? Do you recall what edits were made for the update-fix version? I don't seem to have a matching copy here.


ME: I have to use version 1.0.0.17. Any version past this throws an error as the last part of the process:


I can run the Export/Import fine up until when I drag the .txt file over the script. The last working version is 1.0.0.17. Anything past that will throw an error. Each and every script (.18, .19, .20, .21., .22., .23, and .24) will throw the error such as above. .17 works fine - except that I think there were some issues with the ratings not being there, or something. There were reasons you updated the script each time so if you can get the latest script to work, that would be great.


Or perhaps there is an issue I'm not factoring in? Does it have to be in its own folder (the script)? I have done that.


Somewhat related to this, here is something I asked for clarity on:

Aside from the script past .17 not working, can you clarify what the difference is on these two things in preparing for the E/I script and then executing?


1.   Make a playlist

2.   Drag songs from Windows Explorer folder into it

3.   Running Export/Import

4.   Move songs out of the folder they were in

5.   Put new songs with improved fidelity into the same folder

6.   Drag the .txt file onto the script


Versus this:


1.   Highlight a range of songs

2.   Run Export/Import

3.   Move songs out of the folder they were in

4.   Put new songs with improved fidelity into the same folder

5.   Drag the .txt file onto the script


What does making a playlist first, then dragging songs over into itunes do over just highlighting within iTunes and running the E/I script and doing the same thing where I move original songs out and then put the updated fidelity songs into the same folder and then drag and drop the .txt onto the script?




Dec 18, 2020 4:03 PM in response to turingtest2

YOU SAID:


The track is not modifiable error suggests either a permissions problem (see Repair security permissions for iTunes for Windows - Apple Community), interference by anti-virus software, or in the case of your newly converted files it could be that the software you're using hasn't closed the files yet. Perhaps you need to close that software and/or temporarily disable your AV or set up some folder exclusions.


ME: Seems like that's not the case given that I NEVER get an error message with version 1.0.0.17. So I think we need to figure out why .18-.24 throw errors. 


YOU SAID:


I don't know why the script isn't embedding the images in all the files if they're all selected when you run EmbediTunesArtwork. I can take a look at the code. I know I tested it earlier on and the first pass updated each track in my selection, and running it again only updated the image in the folder, so I was probably trying to avoid

redundantly embedding the same image over and over. It is quite possible I have introduced an error there somewhere while trying to optimise the behaviour.



ME: This is the least of my concerns, but yeah, if you can see an error in the code, that would be great if it were solved.


YOU SAID:


Check the mp3 for internal errors with MP3 val - http://mp3val.sourceforge.net/.


Is the image you're embedding a ,jpg file, or something else? What dimensions?


ME: I'll let you know if I find out anything. There are a few images which are larger than others. Perhaps that's the issue. I'll check it out.

Dec 19, 2020 3:16 PM in response to turingtest2

It's Saturday evening here. I didn't necessarily expect to hear back from you today since it's a weekend, but you've replied on weekends before (which is very nice of you). Nothing more to report really, except to say that the BIGGEST, MAJOR issue I'm having is that the Export/Import is losing file locations. Here's an example capture below. These are identical artist-titles. The only thing different is the file extension.


You can see the exclamation marks. So I have to browse, track-by-track to link them up again. AND, I have to browse from a different, previous (?) browse so I sometimes have to go through about 4-5 different folder clicks to get to the right folder. Quite the pain.

Now what I did try today again was doing (with all songs highlighted in windows before running the script, and while dropping the .txt file on it. And I'm using 1.0.0.17 version as that's the only one that doesn't crash).


  1. create a playlist
  2. drag songs from windows into it
  3. run E/I script
  4. Move out titles to be replaced.
  5. Copy new titles in (...am I supposed to "move them in? Does that make a difference?)
  6. Then I drag the .txt that was created and then I go to iTunes.


Then what I end up with is several missing titles (some make it sometimes, some don't) - or in the case of the capture above, ALL the titles aren't linked.


I do not get what's wrong. And I'm just starting this project portion now that I've done all the grunt work on converting songs and cleaning up, etc. If this is what I have to do for the rest of the project, I'm going to have to reconsider the whole project. I do hope you can find out what's wrong with the script versions .18 - through .24. And also what I might be doing wrong.

As presented yesterday, should I be using a different folder each time before I run E/I script? That would be a major pain if so.


I pray you'll reply quickly as I can get a lot done over the Christmas break if you can help solve my issues. Thank you as always.

Stay safe and I hope to hear from you soon!

Dec 19, 2020 3:20 PM in response to William Richards3

Clarify a portion I just posted above:


Now what I did try today again was doing a playlist inside windows first and I dragged the songs into itunes/playlist. Then, with all songs highlighted in windows, I'll run the script. I'll replace the songs with the upgraded audio (same exact artist/title) and then drop the .txt file onto the script. And I'm using 1.0.0.17 version as that's the only one that doesn't crash).


Even doing that had several titles that get missed. Perhaps it's the Media Monkey ALAC conversion that I'm using within that program? I suppose I could try the other program I used earlier.


Cheers!



Dec 19, 2020 3:44 PM in response to William Richards3

Oh, and finally, if I let iTunes try to find the rest of the missing songs/links


And is there a way I can have iTunes go to the right folder in linking the songs back up if I'm forced to do that)? Maybe after the first browse, is there a way to click something or tell iTunes this is the browse to do now (the folder I just went to for the missing link/song?)


One final thing, I noticed with 1.0.0.17 that artwork doesn't always carry over either. I ran a smart playlist that you showed me how to do and I see some missing artwork that should have carried over from identical artist-title to artist-title when using E/I script. That might be something version .17 didn't do right that you noticed. Anyway, version .23 is the one that I last knew you worked on, though there is a version .24 (you may have done that, but we didn't exchange about it). Keeping my fingers crossed so I don't have to keep doing more work than would be necessary if things worked right (or something I'm not doing right). Thanks!

Dec 21, 2020 11:18 AM in response to William Richards3

Hello,

I was just wondering if you might be able to give me some idea on when you could reply to my responses to your replies from Dec 9? I would be really grateful if you could figure out what I'm doing wrong. I'm absolutely at the point now where I'm going to do all the music conversions. I've worked through a massive number of things on my end unrelated to your scripts and advice (too much to cover here, and nothing you'd really care about anyway), but I am at the point where I have to figure out the best approach if you're not able to figure out - either what I'm doing wrong, or is wrong with the Export/Import scripts. Even version 1.0.0.17 isn't really working per my numerous recent posts of response to you.

I'm at wits end about what I can do. If you can get this righted for me, it would be a HUGE relief and expedite my progress probably a hundred-fold.


Don't mean to bug, I'm just asking if you have any idea when you'd have time to reply. And I'll offer again that I'm willing to pay for the help if that's doable (within reason of course, haha).


Thanks so much!

Dec 26, 2020 1:37 PM in response to William Richards3

I've discovered more issues as I've been slowly and methodically working my way through things.


Using 1.0.0.17 - since it's the only one that won't throw the error.


Pros:  It completes the process on the Import.


Cons:


1.     Loses track of songs. Rarely, if ever, will it see all the songs so I have to go through one-by-one. 


CustomRenamer:


Pros: Works through the script


Cons:

1.     I discovered that Album Titles will mostly be missing.

2.     Also discovered that the Year will also be missing on many of the song(s)

3.     I also discovered that the year can be wrong on some files - as though it's not respecting the correct years.


What script can I run so that the Album title and year (metadata) all carries over to the windows explorer?  I don't think

it's EmbedAlbumArt or CreateFolderArt - neither of those has to do with that.


I'm glad I caught this. And I definitely had these albums/years showing up in Windows explorer before.


Because I'm awaiting feedback, I'm kind of not sure which way to turn. But as concise as I can be, here is what i'm needing help with.


  1. Confirm the exact process to get the Export/Import to work properly. Try to replicate my situation which would be.
  2. Confirm/explain the difference between creating a playlist and dragging files from windows explorer into the playlist, versus just highlighting songs in a search.
  3. See why the album title/year (and maybe other metadata I haven't noticed yet) isn't carrying over to Windows explorer after I run CustomRenamer. Perhaps that script has some issue? The actual result in the new Drive and subsequent folder(s) the new baud rates are going into comes out correctly - it's just the album and year (and perhaps more) are not showing up in windows explorer. This could be (and likely is) why you updated version 1.0.017 to later builds 1.0.0.18 through .24. But since I can't get those scripts to run successfully, my only solve is to use .17 version.
  4. After I've already run several artists as I have begun this final home stretch, is there a script that could run and add those to missing metadata (re: #3 above) so I don't have to manually do this?
  5. Is there a problem between the Media Monkey converting from .wav (or .flac) to ALAC M4A files and those I convert using DBPowerAmp? I only mention as an attempt to figure this out.


You were also going to try and update the EmbedAlbumArt so that I could run it on an entire drive versus going through folder by folder. You had said it should work but when I did, it wouldn't work. This is very low on my priority list.


Thanks. I do hope to hear from you. You spoiled me with so much quick reply and help along the way so I'm just very frustrated as this is all slowing me down big-time. I'm appreciative, as always, so please post back when you can, and as soon as you can. Thank you.

Dec 26, 2020 3:10 PM in response to William Richards3

I am so sorry to hit you again as I know I'm being redundant but I went and looked through a lot of other music I have already upgraded fidelity and moved to the new drive. The Year is missing from all of them (though I had previously put the album name manually and just didn't bring it up yet I don't think). But it's critically important that all the metadata get carried over.


As per the recent post directly above this one; is their a script I can run that will update the year (and album)? Or modify an existing one that will work. It seems to me that the CustomRenamer is only doing this (?) because that's all that's in the script?

MEDIA\MUSIC\<Artist>\<Album>\<Artist>- <Name>?


I tried modifying the script to add "Year" but it didn't work. And since the Artist and then Album name is what creates the respective folders, I don't think that is why the album and year isn't showing up in windows explorer.


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.