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
Question marked as Top-ranking reply

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

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

Sep 4, 2020 3:56 PM in response to William Richards3

William Richards3 wrote:

YOU SAID: To test it I first used the script to export metadata and artwork for a sample track. I then used iTunes to create a
copy of that track in Apple Lossless format

ME: Did you run the export/import script first above?  Are you saying you highlighted a track in iTunes and said to create a copy of that into lossless?  Was this just for demonstrative purposes? Taking a 160 file to lossless wouldn't be apropos would it?


As mentioned in the annotation to the image I used the iTunes created ALAC file to simulate a fresh conversion from a .wav original. I'm well aware that isn't exactly what you're going to do, but I didn't feel the need to break out a CD player and make some fresh .wav rips just to illustrate the use of this script.


YOU SAID: .. edited or removed most of the metadata from the ALAC version, including the artwork and the lyrics. I then removed the ALAC copy from the library without deleting the file, and moved the original .mp3 to a new folder to break the link to the library. Next I ran the ExportImport script in import mode

ME: Are you talking about running the "export" and then running the "import" script - I'm confused as it's just one script isn't it? How does it know which it is doing?


If you run the script by double-clicking on it in Windows Explorer it runs in export mode, against the tracks that are selected in iTunes. If you drag and drop a text file onto it then it runs in import mode. Maintaining one script is easier than maintaining two that are interdependent.


YOU SAID: ..by dragging and dropping the exported metadata file onto the script. The script connected the now-broken entry in the library that was pointed at the missing .mp3 file to the new .m4a ALAC replacement, and restored the correct metadata including artwork image and lyrics.

ME: So at what point did you move the ALAC version back into the library or into the folder the 160 resided in?


I didn't. The script started importing metadata for the original entry in the library, discovered that the 01 Take On Me.mp3 file was no longer in the folder, then looked for other files in the folder of the form 01 Take On Me.<ext> with the options of .m4a, .mp3, .aif, .aiff, and .wav. Once it found a file called 01 Take On Me.m4a it connected iTunes to that, then proceeded to restore the original archived metadata, including lyrics and artwork. This is what you've asked for.


YOU SAID: Apple Lossless version with edited metadata to simulate a fresh conversion from a .wav original. Note I'm not
using the iTunes features to keep the media folder organized, so changing properties here doesn't change the filename or location:

ME: You didn't indicate a .wav file above. You said you converted to ALAC within iTunes on the original file I thought. I'm
confused here.  Again, should I use the "keep media folder organized"? And just what does that do (or not) related to your last sentence above?


I've probably introduced unnecessary detail here, the key point is that for the script to be able to automatically relink <path>\<song>.<ext1> to <path>\<song>.<ext2> the first file has to disappear, and the second one must be exactly the same except for <ext2>.


And I'm confused by the screen shots for the export/import.  Does your script know that you've run it once and then when you run it again it runs the other part?  Here's the two script views in your captures:


Again context comes from how you launch the script.


YOU SAID: And the library now has an Apple Lossless version instead of the mp3 copy, with all of the same metadata:

ME: I'm kind of lost, I'm so sorry to say.  Perhaps if you could list the steps without images and your flow, that would help. 

I can give it a try but there's one spot here that I'm very confused by - which is the first part where you talked about
making a copy within iTunes.


Again, me making a copy using iTunes was to simulate you converting your .wav original with whatever tool you use.


You need the new version of ExportImport, version 1.0.0.17 dated September 4th.




So, step by step once more:


  1. Select a track that you want to upgrade in iTunes.
  2. Run the ExportImport script by double-clicking the script in Windows Explorer.
  3. Use whatever process it is that you have to make your new higher resolution copy, put it in the same folder as the original that you are replacing and remove the original. This must be in the same folder, and with the same filename apart from the file extension.
  4. Drag and drop the Export Import [<Date> <Time>].txt file that was created in step 2 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.



This process should work the same way for 10 or 100 files as it does for one.



tt2

Aug 28, 2020 5:53 PM in response to William Richards3

Seems my web host had some issues yesterday, but http://samsoft.org.uk/iTunes/scripts.asp is reachable now. This link to ExportImport should take you to the right spot on the page.



The death of iTunes has been somewhat exaggerated. Apple have chosen to split up its functions in Catalina in the same way they are split in iOS. Not entirely successfully in my opinion, but there we go. iTunes for Windows remains essentially the same.



See Duplicate songs in iTunes - Apple Community for general advice on deduping. The script for that can be set to preserve the highest quality version, and can merge rating, play counts, playlist membership etc. It matches tracks on unique combinations of key track properties, track & disc number, name, album artist, and album. In its current form it doesn't check or merge sundry information such as composer or comments, although that could potentially be added.



I don't recall the original thread you refer to but perhaps I talked about embedding artwork before deduping to ensure that whatever track is kept has artwork. I have two scripts that can potentially help with this, CreateFolderArt and EmbedFolderArt.


The scripts have a slightly different purpose.


CreateFolderArt ensures that every album folder ends up with a Folder.jpg image which is the art that iTunes already knows about. Side effects are that if artwork has been updated in iTunes the folder art should be updated also, and if any track from the album doesn't have embedded artwork it gets embedded.


EmbedFolderArt was actually written for someone who already had various artwork images stored in the folders and wanted them added to their tracks, but not if iTunes had already downloaded a better quality image. It creates new files of any store art with the name iTunesArt.jpg, then embeds the largest image by area on the premise that this is likely to be the best image.



In the context of deduping these may only be effective if the tracks in different formats have been gathered into a single folder for each album, which might not always be the case.



tt2





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

William Richards3 wrote:

1. I'm not going to re-rip the CDs. I've already ripped those to wav when I initially burned all my music over the many years. I did that as I anticipated that I would be looking at updating the library with higher than 160 baud rate at some point down the road (which is now). The reason I only did 160 originally was due to the space limitations on the iPods. So what I'll do is convert the wav to AIFF or AAC or MP3 (any suggestions on which is better?), while still saving the original wav.


The main drawback with wav is that is doesn't hold a tag. Any metadata that iTunes shows lives only in the library. Wav files imported into a library arrive with the filename parsed as the track name, and that's it. Can assume that the wav files you will be converting already exist in iTunes and have details such as track name, artist, album, etc., and that you'll be using iTunes to convert to the destination format? I would suggest that the best lossless format to use is Apple Lossless since it has full tag support and doesn't lose any information. If you need to use the tracks in an environment that doesn't work with Apple Lossless then MP3 generally has the most widespread support.


I just tested the CreateFolderArt script again. Here's what I did:

I converted the same song to a higher baud rate - that file is in a different folder unrelated to the original.
2. I then highlighted the song in i-Tunes
3. I ran your script. It asked Yes or No. I chose No.
4. I then moved the song out of the folder it was in and moved to a different unrelated folder.
5. I then moved the new one into the folder the original occupied.
6. I highlighted the song in i-Tunes
7. I reran your script. I chose No when asked.

All the metadata was there - and the album art was as well. And this is positively the new, updated baud file. (original was 160, I replaced with 320).
The only thing missing was the Lyrics. Could your script somehow be updated to include lyrics? If not, that is totally fine. I have very few files honestly that have lyrics so if those lyrics are lost, that's okay.


Generally converting a file to a new format in iTunes preserves all metadata. Another script ConvertFormat could potentially be altered to capture and copy over any fields that iTunes drops in this process, and leave the original in place.


What is the Yes mean? Is that telling the scrip to find something in iTunes store to download? Is there a time when I would want to choose Yes?


In common with my other scripts the dialog box shows what actions the options perform. In the case of CreateFolderArt No essentially only adds images to the album folders where none exist already, Yes allows other effects such as comparing the age of the artwork in the folder with the last modification date of each file processed in an effort to capture the newest image, then applies that image to all tracks from the same album that are within the selection being processed.



BTW, I'm still working in iTunes 10.7 because I hate the later versions. I suppose I should update now as part of all this? Your scripts will still work in the latest/last version of iTunes I assume?


My scripts should work in any build of iTunes for Windows. Apple haven't made any significant changes to the Windows script interface in a long time. iTunes 12.7.2.58 (or iTunes 12.6.5.3 for app support) are the minimum builds that can communicate with the iTunes Store. Moving a library forward to a later build is supported, going back isn't.


Now as it relates back to the CreateFolderArt (CFA) script and the success I had today in running it, I will have to do songs one at a time for those songs that are the "one-hit wonder" variety, or might be split up in different folders. I'm in the radio business and have hundreds of radio-only broadcast disc libraries. For example, in the 500 series, disc 501, there are songs from Three Dog Night, Bob Dylan, Chicago, Doobie Brothers, The Doors, ELO, Elton John, etc. So those songs are from the various albums from each artist. So rather than burning the CD which had all these songs by album - e.g. "Elton John - Honky Chateau" - I added the songs from each disc and then any missing ones not included on the disc libraries, I would then burn from the album.


CreateFolderArt works when all tracks from the same album are in the same folder, and at least one has artwork. The related tracks all need to be selected before the script is called. After running the script each track will have the artwork embedded. As long as tracks are in a conventional layout multiple albums, or indeed an entire iTunes library, can be selected and processed in one pass. If reorganizing your library in this fashion is not desirable then it should be possible to come up with another approach, e.g. a variation that uses a single folder to store and retrieve images using the form <Artist> - <Album>.jpg.




To be continued...



tt2

Aug 31, 2020 6:01 PM in response to turingtest2

turingtest2 wrote:

I've had a look and ExportImport already allows for lyrics to be archived and restored so I would suggest you test it on a few tracks to see how well it works for you.


To be clear you would run the script while you have some tracks that you are going to upgrade selected. This produces an output file containing all the metadata. You would then overwrite the files with the new conversions of the wav originals. Finally you would drag and drop the output file onto the script to import the exported metadata. (Which is what I assumed you were doing all along, hence my confusion.)


tt2

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

Continued...


I'll convert the wav files for each of these discs from each series to the new baud rate/type. But I'm wondering if there's any manageable way that you can think of to make this process easier? Meaning, an album by Elton John mentioned above is scattered in a variety of different folders (some burned from the album itself that I have that wasn't on the radio-only discs). If I could sort my library by file location, that would perhaps make it easier as I could just highlight each folder group and do en mass but I don't see a field for file location on the column choices in iTunes. I know when you export the library that does show so perhaps there's a way to do it by exporting and then importing it back somehow but making it ordered (though I don't know if the sort order from an excel file carries over back into iTunes if you follow).


For actions you perform within iTunes, such as converting tracks to a new format, it doesn't matter where the originals live, as long as they can be reached. The converted files will be put into the standard iTunes locations, which for music files is typically <Media Folder>\Music\<Album Artist>\<Album>\## <Name>.<Ext>. Personally I found the best way to work systematically through the library was to use the column browser and work one artist at a time, fixing any issues I found with their albums, e.g. one album split into multiple groups, and keep tracks of where I'd got up to. If possible I will also use smart playlists to gather tracks that I want to process, and scripts to make systematic changes. An example might be making sure that "Mr " is always changed to "Mr. ". Eventually I developed a TitleCase script that enforces all of my various preferences and layout rules in a consistent fashion, complete with exception lists for when a simple rule has the wrong outcome.


What I'm going to do with the new library is put all the artists in the proper folder. Once I have all the new baud rate with the included metadata, I'm going to then starting moving to folders by Artist, Album. Then iTunes will need to find them in the new location (could that be another script?) But I planned to do that after I updated the baud rate so that part is done as I said.


If nothing else is holding you to your current folder arrangement you can enable the option under Edit > Preferences > Advanced to Keep the iTunes Media folder organized. You shouldn't move anything by hand as iTunes will lose track of it. If you really want to enforce a personal structure different from the one that iTunes uses see CustomRenamer.


Because of the immense amount of work it took to enter the data into each song (that was charted in Billboard), I'd hate to have to redo those one-by-one. I have contemplated just exporting the library, then rebuilding it so all the artists/albums are in their own folder and not have this scattered about. I have so many folders where different music is - including some that are in the Music/iTunes/iTunes Music folder. on C: I did it this way to keep it straight in my mind what each represents.


iTunes Music is the older name for what would now be called iTunes Media. See Make a split library portable - Apple Community for more on the standard layout for an iTunes library.


You're obviously brilliant with this stuff so I'm hoping you have some suggestions.

So sorry to ask but what does the ImportExport script do again? I read your overview but I don't think I need that do I?



ExportImport is designed to export and import selected metadata. The exported data can potentially be edited before import. The original purpose was to restored corrupted metadata when a user hasn't kept a full backup of their library by using the data archived in a Previous iTunes Libraries backup of the database. Use case would be accidentally changing all album titles instead of one. iTunes doesn't have an undo button, but the data can be retrieved and reapplied. This script normally relies on the LibraryPersistentID of each track being unchanged in such a scenario, so it wouldn't matter if iTunes had rearranged the files in response to the edit.


A side note: How does the iTunes media folder location work? I've always wondered that. I set it to a hard-drive outside of MyMusic/iTunes on the C: drive. So any tracks I happen to burn off CD will go in that folder and sub-folders (per artist). Is there any constraints or things I should concern myself with there?


Again see Make a split library portable - Apple Community. I would recommend using the media folder X:\iTunes\iTunes Media where X: is the drive where you want your media to live, that way it is easy enough to move the library files from C: into X:\iTunes if/when you need to think about moving the library to a new drive or computer.


I'm sorry to throw all of this at you. Thank you deeply for your replies. You're amazing! Thanks so much.


You're welcome. 🙂


tt2

Aug 31, 2020 1:54 PM in response to William Richards3

William Richards3 wrote:

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.


After hitting reply you can use the quote tool in the toolbar to quote the previous post. If you carefully add in a couple of blank lines at the place where you want to comment you can create a non-shaded area to contrast the quote and the reply. I've noticed that sometimes the first character of the quoted message in the second block gets removed so look out for that and replace it.

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.

Slightly confused here. That script as written is good for creating artwork images in the folders where the tracks live. Are you referring to ExportImport here? When you forcibly replace one copy of an mp3 file with another working outside of iTunes it has no way of knowing that you've done so. All metadata in iTunes will remain as is until iTunes discovers the change, which usually happens when the file is played. Another script called UpdateTagInfo can be used to force iTunes to recognize the changes.


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?


Everything in context. With many of the scripts Yes processes everything automatically, and No allows for track by track confirmation of updates. In each script the dialog box will tell you what the outcome should be of using either option.


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?


Yes, Description is normally used for Videos and Podcasts. In recent builds it has been hidden from Song Info for music items, but it can still be displayed in the Songs view and updated using a script.


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.


Going back to CreateFolderArt, I think it might be useful for you if I could make a version that stores all exported images in fixed location and format so that it won't matter that tracks from the same album are scattered between multiple folders. I can also look at the possibility of adding Lyrics into the ExportImport script. Hmm, perhaps there is a scope here for artwork too so that one script can be used instead of two.


As I see things at the moment exporting metadata with ExportImport, replacing files with new conversions in a similar file format but a higher bitrate, then reimporting the metadata with ExportImport again should be a fairly robust process if I can address the issues with artwork and lyrics. Changing to a different format, such as AIFF, AAC or Apple Lossless will be more complicated because of the change in file extension. ExportImport currently uses LibraryPersistentID, a unique internal identifier for each track, to identify each track as it exports or imports metadata. If you're going from one format to another then <file path> ignoring the file extension could be a potential alternate key (database terminology) for locating the right file to apply the imported metadata to. In addition there would need to be a mechanism to change the location property of the track record in iTunes so that it switches, for example, from <some path>\<filename>.mp3 to <some path>\<filename>.m4a.


tt2

Sep 7, 2020 2:53 PM in response to William Richards3

Anything older than 12.6.5.3 or 12.7.2.58 has outdated security components (the deprecated TLS 1.0) and cannot connect to the iTunes Store securely. This may be the cause of your issues using the store.




Again the steps should be like this:


  1. Select one or more tracks in iTunes that you wish to upgrade.
  2. Run ExportImport in export mode by double-clicking on it directly. It doesn't matter where you store the script, but perhaps its own folder on the desktop might be easiest since it won't get in the way of other content. Note which export .txt file was created, you'll be using it in step 4.
  3. Remove the files that you are upgrading from their respective folders and replace them with new files with the same names apart from the file extension.
  4. Drag the file you exported in step 2 onto the ExportImport script and let go to run the script in import mode.
  5. Check your new imports have all the properties you want from them, both in iTunes and Windows Explorer.



You don't manually add any of the new files to iTunes. During import the script examines each line of the exported file in turn. As it reaches the point of processing a Location property, and notices that iTunes no longer sees the relevant file on its old path the script uses that property as a template to find a different file in the original folder, with exactly the same filename, but a different extension. When it finds that it then makes sure that every other property stored for that track in the exported .txt file is written to the newly relinked file. To be clear the script should work if you replace <Path>\Example song.mp3 with <Path>\Example song.m4a. You must move or delete Example song.mp3 (so iTunes reports its location to the script as an empty string), the replacement file must have a different file extension (there is a workaround for that, but another time), and the replacement must be called Example song.<ext> not Example track.<ext>. (For example!)


There is only ever one entry for each track in iTunes. You export metadata from the original entry, replace the file, and use the script to link iTunes to the replacement (it needs a hand because the file extension is different, which means the full path is different) and then reapplies all of the exported properties in a way that ensures they are really embedded in the tag, and thus the standalone file should work correctly in other apps that have no access to the iTunes library.


Again, let's please leave discussion of other clean up operations to one side and focus on this upsampling task. I feel we're nearly there. I'm not sure discussing artwork cleanup and library structure at the same time is necessarily helping.


tt2

Sep 16, 2020 3:15 PM in response to William Richards3

William Richards3 wrote:

Hi!
YOU SAID: If you use my other script to upsample your content it is going to ensure that all the new copies have embedded art.

ME: I'm sorry, which script is that, and what do you mean that "all the new copies have embedded art?"

YOU SAID: When iTunes fetches artwork it only downloads an image to store in its cache. That image isn't automatically written to the tag, so iTunes may show the correct image, but Explorer can show a generic icon, or perhaps something unrelated due to the dbPoweramp shell extension. You can copy the image and then paste into the top left corner to embed in the track, or use another of my scripts.

ME: I don't think this is due to the dB shell. You may be right, but I could restore to a time in windows I set before installing and see what that looks like. I'm not sure what you mean on your last sentence. Sorry.


Here is an album that is missing art in both iTunes and Windows Explorer:


I can use the iTunes Get Album Artwork feature to fetch art from the iTunes Store:


iTunes can now show art, but it isn't embedded in the tracks. You can embed the store art like this:


And when finished you can see the embedded artwork shows in Windows Explorer:


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


When using the ExportImport script to replace, for example, .mp3 versions of files with Apple Lossless copies, the export phase is going to cache the art that iTunes knows about for each album as ..\Artwork\<Artist> - <Album>.jpg in the same folder as the script, then when you use the import phase the relevant images will be embedded into the tracks.


Even if Windows is currently showing the wrong artwork for an album that you're going to upgrade after using the ExportImport process the new copy should have the right image embedded in it.


As noted previously I can cook up a script to automatically embed the current iTunes artwork of selected tracks so you can fix the artwork issues in advance of the upsampling project if you wish.




You've reminded me you're using iTunes 10.7. If I recall correctly the Get Info dialog is slightly different but it is still possible to refresh/embed store downloaded art in a similar fashion. I think you can copy and paste to the large artwork image. If that doesn't work you may need to copy, delete, paste. Either way the script approach gets rid of all of the fiddly bits of selecting, copying, pasting, and working one album at a time.




Let's leave fixing Plex until we're certain that images you embed in iTunes show correctly in Windows Explorer.




tt2

Aug 29, 2020 6:18 PM in response to William Richards3

For most of my scripts the mode of operation is to select some tracks in iTunes, run the script, and follow the prompts. CreateFolderArt is no different in that respect, but it does assume that tracks from the same album are in one folder, with no other tracks present in that folder, which clearly isn't the case with your current layout. Let us put that script aside for now.


I assume you're going to rerip or redownload copies of CDs that are already in the library, which will create duplicates.


My DeDuper script works on the assumption that your duplicate tracks will match what iTunes calls Same Album Duplicates. These have matching values for disc & track number, song name, artist/album artist, and album title. The script scans a selection of tracks looking for pairs with matching properties, determines which should be kept on the basis of size or preferred format, then merges play & skip counts to the keeper (setting the other to zero), adds the keeper to any playlists the discard is in, and sets the keeper to the highest rating, and play/skip date of the two. Discards are unchecked and then optionally removed from the library if you proceed with clean up, making it possible to non-destructively test that things are working as required. If I recall correctly I've made a tweak that can allow it to preserve date added in some circumstances which I could make a more definitely controlled option. I could also add in options to copy artwork, BPM, comments, composer, genre, and grouping from the original to the replacement track. Would that work for you?



FWIW I've tracked down some previous correspondence regarding DateArranger at When I export a playlist and then open in… - Apple Community though I haven't gone over it all yet.



tt2

Aug 31, 2020 8:35 AM in response to William Richards3

If I might make another observation: originally, you talked about replacing your files with ones of higher quality, but now you repeatedly mention converting them.


Converting a file from 160Kbps to a higher Bit Rate will not give you any increase in sound quality - you cannot add something that isn't there. Likewise, repeated conversion from one format to another risks errors and a loss in quality due to the conversion process, so converting the wav files (which could be higher quality than the MP3 files) risks introducing errors.


You also said that you had no intention of re-ripping your CDs, and yet you now say that you intend to use a third-party app to convert existing files. I'm not convinced that would be any less work, but as stated, conversions will not give you better (or improved) sound quality.


Why don't you consider re-ripping those albums for which you still have the CDs? Providing the artist, album title and even the track names is the same as your original rip, iTunes will write the new copy over the old one - actually replacing the existing files, achieving what you wish to do. I've re-ripped albums and the Play Count, star rating and its place in Playlists is unaffected.


From memory, I recall that re-ripping a CD will preserve fields such as the comments field as well. If you doubt this, why not try it for one album as a test? If you use one with plenty of additional data that you've added (and an album with a low track count), you only need to document that information for a few songs and then add it back in - if it's lost (which I doubt it will be).


Note that the reason the album information needs to be identical is so that when iTunes starts the rip, it will find the identical file name in the same folders that it's trying to use, so it will ask if you wish to replace the file. If there is any difference, iTunes will make a new file, rather than replace the old one.

Aug 31, 2020 12:58 PM in response to William Richards3

William Richards3 wrote:

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.

OK, originals held independently of iTunes, and converted independently too. Got it. So how are you planning to get iTunes to recognize the replacement file? If you're using the same file format then you can overwrite say a 160k mp3 file with a 320k version of the same track with the original filename and path and iTunes will use the new file. Though it might not immediately notice the change of bitrate etc. it should update that information when tracks are played.


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.


Got it.


Then 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?


It would be useful to know exactly what the error message was. The script runs OK here.

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.


Let's treat that script as another dead end. It would be useful if your wav files were already in iTunes and you were using iTunes to make the newly converted tracks in your target format. Since you're not, it isn't.


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.


The script KeywordsToDescription with the keyword <Location> can be used to push the filepath of each track into the Description field.


Perhaps there's another approach as you suggest might be possible. Hopefully

https://discussions.apple.com/content/attachment/5d320dc8-f50e-4492-9d2f-284b70954642
I've explained this.
Here's an example of my folder structure (just some of many folders):


I sense a thought got interrupted here so I will end here also and try to respond to the posts that followed this one.


tt2

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

Select the Alanis Morissette track, press Ctrl+i and look at the File tab. What is listed against id3 tag? Is this a track that you upsampled with the assistance of ExportImport, or just renamed with CustomRenamer? Note that custom renamer doesn't have any impact on tag metadata, it only moves/renames files and makes sure iTunes stills knows where to look for them.


tt2

Aug 31, 2020 2:14 PM in response to William Richards3

The .XML file is used by iTunes to let other applications know about the state of the library, iTunes doesn't read from it, although it can be imported. Replacing the XML with a backup copy shouldn't make any impact on what you see in iTunes. The core database is the .ITL. Replacing this will change what you see when iTunes loads up, but doesn't affect metadata that has been stored in files. If there is a discrepancy iTunes generally catches up with what it is in the file when a track is played.


It is generally wise to test any tool on a small representative sample to see it works are desired before letting it loose on your entire library. I haven't reiterated it here but my scripts page includes similar advice along with further details on the use of the KeywordsToField scripts.


And yes CreateFolderArt can be run in bulk, but it assumes that each folder only contains tracks from a single album. It won't work for you in its current form. I can fold in the function of archiving/restoring the current artwork image for each album into ExportImport script, and capture Lyrics too. Give me a few days to play with it.


tt2

Sep 1, 2020 1:13 PM in response to William Richards3

William Richards3 wrote:

I'll try my best but would be appreciated if you took me step-by-step through this.


I'll do my best. I'll work on an updated version of ExportImport then try to illustrate it in operation.


Of you say the .txt data was odd to show up in the folder where the EI script resides, where else would it be found? Is that a setting you can set?

Not sure on this to be honest.


I was referring to the errors when using CreateFolderArt to save artwork images. You posted two screenshots where the script lets you know where it is trying to save the image when there is a problem. Again this isn't updating anything in the library so shouldn't be an issue.


Again, was any corruption done on my extensive library since I had to stop the script as it was attempting to apply to other songs even though I only had one highlighted?


I don't think so, but only you know what to look for. Use the Song view and sort by Date Modified, descending. You can then review any recent changes to the library.


And this would need to be done one song at a time which would be tedious to say the least. (Unless I'm missing something).


The script can be used in batch mode. Testing with one or two files at a time makes sense while we're still working on the process.


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.