How to Change Letter Cases in iTunes

itunessnow leopard

I have some iTunes music files that are all capitalized letters and others that are normal small case letters. Instead of me going through and renaming each capitalized music file’s data is there a way that I could make iTunes default all music files and their data to small caps? …a way in Terminal or through and the iTunes Music Library.xml file, or…?

I have swapped out the iTunes Music Library.xml file and the iTunes Library.itl file with new fresh files from an unused iTunes from another computer, but when I reinstall music files back into the Music folder it goes right back to being capitalized letters even though I had changed those large caps to small caps earlier.

I prefer not to rename 100’s of music files so I’m hoping there is a simpler way of doing this via some forced code somewhere. Any suggestions?

Best Answer

You asked specifically about defaulting all music files and their data to small caps. I think you mean "title case," like this:

This Is Title Case

Assuming that is what you want, and considering that you mention you already have some files that are all caps and others that are all lower case, perhaps you will get the result you want by changing the names-- automatically-- inside of iTunes. Not quite "on the way in" but easily and quickly afterward.

iTunes is very AppleScript-able and it can solve your problem. Here is a script that I wrote to do it. Note that it operates on whichever tracks are selected. I was using iTunes 12.4.1.6 to test, with "My Music" clicked at the top and "Songs" clicked in the sidebar to the left. I select multiple tracks and then ran this script in the Script Editor:

-- Uses the satimage osax
-- Get it at http://www.satimage.fr/software/en/downloads/downloads_companion_osaxen.html

tell application "iTunes"
    set the_tracks to the selection
    repeat with a_track in the_tracks
        set the_old_name to name of a_track as string
        set the_new_name to titlecase the_old_name
        set the name of a_track to the_new_name
    end repeat
end tell

Very important: you must install the Satimage OSAX as indicated in the script. Plain vanilla AppleScript does not do "titlecase" out of the box. There are ways to do it but the Satimage OSAX is the fastest and easiest.

I wrote the script to be self-explanatory and it could be sped up a little. Still, this should do the job for you. I applied the script to 100 tracks and it finished in less than three seconds. You might try it on just a couple of badly-formatted titles to see it work before selecting a large number of tracks. Test the script and be sure it does what you want before making wholesale changes to your iTunes library.

Yes you would have to run the script again if you imported more songs. But, you could make a Smart Playlist based on Date Added and run the script once a month or so on whatever new tracks you'd imported (and they would be in that Smart Playlist).

AppleScript can "get" and "set" a lot of information for an iTunes track. Title, Album, etc. Here is what you get when you run this script (with some track or tracks selected in iTunes):

tell application "iTunes"
    set the_tracks to the selection
    set my_track to item 1 of the_tracks
    set x to properties of my_track
end tell

{class:file track, id:32579, index:23, name:"Agnus Dei", persistent ID:"23958CCD4BBB2A10", database ID:11459, date added:date "Wednesday, March 16, 2011 at 10:01:56 AM", time:"6:06", duration:366.471008300781, artist:"John Rutter", album artist:"", composer:"", album:"Requiem", genre:"misc", bit rate:128, sample rate:44100, track count:0, track number:5, disc count:0, disc number:0, size:5864189, volume adjustment:0, year:0, comment:"", EQ:"", kind:"MPEG audio file", media kind:music, video kind:none, modification date:date "Thursday, June 16, 2016 at 8:28:57 AM", enabled:true, start:0.0, finish:366.471008300781, played count:0, skipped count:0, compilation:false, rating:0, bpm:0, grouping:"", bookmarkable:false, bookmark:0.0, shufflable:true, lyrics:"", category:"", description:"", show:"", season number:0, episode ID:"", episode number:0, unplayed:true, sort name:"", sort album:"", sort artist:"", sort composer:"", sort album artist:"", sort show:"", loved:false, album loved:false, cloud status:matched, location:alias "CB SSD:Users:cboyce:Music:iTunes:iTunes Music:John Rutter:Requiem:05 Agnus Dei 1.mp3"}

You can see Name, Artist, Album Artist, Album, Comment, etc. Lots of info that you could get, change the case, and set.