Categories: Misc / DotNet / Java / Coder / Linux / PHP Ask - La ask - La Answer

change all tracks to lowercase

hello, i want to change all my track / artist / album names in itunes to lowercase. i've tried these applescripts without much luck...
Track Names to UN-Word Caps.scpt
Track Names to Sentence Caps.scpt

they change the case but screw my titles up sometimes. anybody know the best solution to do this?

thanks,
c.j.
[349 byte] By [cj070] at [2007-11-9 15:09:49]
# 1 Re: change all tracks to lowercase
Those two scripts, as their names clearly indicate, do not change your track titles to all lower case.

This will convert the selected tracks' names to all lower case:

property ucha : {"?", "?", "?", "?", "?", "?", "?", "?", ?
"?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", ?
"?", "?", "?", "?", "?", "?", "?", "?", "?"}
property lcha : {"?", "?", "?", "?", "?", "?", "?", "?", ?
"?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", ?
"?", "?", "?", "?", "?", "?", "?"}
tell application "iTunes"
if selection is not {} then -- if tracks are selected...
set oldfi to fixed indexing
set fixed indexing to true

set sel to get a reference to selection
with timeout of 30000 seconds
repeat with aTrack in sel
set atracksname to aTrack's name

set tempname to ""
with timeout of 30000 seconds

repeat with j from 1 to length of atracksname

set asc1 to (ASCII number of (character j of atracksname))
if (asc1 is greater than 64) and (asc1 is less than 91) then
set tempname to (tempname & (ASCII character (asc1 + 32)))
else
set x to character j of atracksname
repeat with ac from 1 to count of items in lcha
if item ac of ucha = x then set x to item ac of lcha
end repeat
set tempname to tempname & x
end if
end repeat -- with a character of atracksname
end timeout

set aTrack's name to tempname
end repeat
end timeout
set fixed indexing to oldfi
display dialog "Done." buttons {"Thanks"} default button 1 with icon 1 giving up after 15
end if
end tell
Copy and paste to Script Editor, Save As whatever you like in Library > iTunes > Scripts
Doug Adams at 2007-11-15 17:24:59 >
# 2 Re: change all tracks to lowercase
thanks, works great!
cj070 at 2007-11-15 17:26:01 >
# 3 Re: change all tracks to lowercase
hey, is there also a way to change case of the artist and album to all lowercase? i appreciate all the help you've provided thus far.

thanks again,
c.j. sanders
cj070 at 2007-11-15 17:27:10 >
# 4 Re: change all tracks to lowercase
Sure, but you have to do a little editing on these two lines:

set atracksname to aTrack's name

and

set aTrack's name to tempname

Just change "name" in each line to either artist or album, then save.
Doug Adams at 2007-11-15 17:28:05 >
# 5 Re: change all tracks to lowercase
Originally posted by Doug Adams
Sure, but you have to do a little editing on these two lines:

set atracksname to aTrack's name

and

set aTrack's name to tempname

Just change "name" in each line to either artist or album, then save.

I used the script for changing the tracks name to Sentence Case, but I cannot do that to the artist names. Can you please help me? I don't want to edit 1 by 1 the artist names. They are about 1000 with capitals!

Please note that my Applescript skill is bad.

Thank you very much,

Kostas from Greece
kostthem at 2007-11-15 17:29:04 >
# 6 Re: change all tracks to lowercase
Hi. I tried using the lowercase script code that Doug posted above, but when I tried to save it in Script Editor I got an error message reading, "Expected expression found but unknown token" and the last question mark at the end of the first line was highlighted. I assume this has to do with changes in the Script Editor since 2003. Any suggestions?
Thanks for any help you have time to provide,
Jeremy
bzooty at 2007-11-15 17:30:13 >
# 7 Re: change all tracks to lowercase
Finally, I did my job with the script "proper English Title Capitalation". It's the best!
kostthem at 2007-11-15 17:31:06 >
[an error occurred while processing this directive]
[an error occurred while processing this directive]