Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Rename multiple iTunes songs

Hi,
I have just imported 165 mp3 files, which do have nice and proper ID3 tags but song name is in wrong format, it is like: "123.Songname" or, three digit and dot, no space, then the real name. Is there some automatic way how to remove first four characters from the name of each song?

MacBook, Mac OS X (10.4.11)

Posted on Nov 14, 2008 6:31 PM

Reply
8 replies

Nov 14, 2008 7:54 PM in response to Jirka Cech

I have a script that I wrote to strip the first word (track number) of a file name that should do the trick. It can be run as a script, applet, or droplet. Spaces, periods, and dashes (not underscores) are word delimiters, so filenames that begin with any number separated by one of those are renamed:

<pre style="
font-family: Monaco, 'Courier New', Courier, monospace;
font-size: 10px;
margin: 0px;
padding: 5px;
border: 1px solid #000000;
width: 720px; height: 340px;
color: #000000;
background-color: #FFDDFF;
overflow: auto;"
title="this text can be pasted into the Script Editor">
-- strip CD track numbers
-- contents of subfolders are not read

property SingleFile : false -- set to true to select individual files

on run -- double-clicked
if SingleFile then
set FileList to (choose file with multiple selections allowed without invisibles)
else
set FileList to (choose folder with multiple selections allowed without invisibles)
end if
open FileList
end run

on open FileList -- items dropped
set MyList to {}
repeat with SomeFile in FileList
if folder of (info for SomeFile) then -- expand folder contents
try
tell application "Finder" to set MyList to MyList & (get every file of SomeFile) as alias list
on error -- Tiger
tell application "Finder" to set MyList to MyList & (get every file of SomeFile) as alias as list
end try
else
set the end of MyList to SomeFile
end if
end repeat

tell application "Finder" to repeat with SomeFile in MyList
set TheName to the name of SomeFile
try -- strip a track number prefix if it exists
get (the first word of TheName) as number as text -- "words" are delimiter sensitive
set the name of SomeFile to text (word 2) thru -1 of TheName
end try
end repeat
end open
</pre>

Nov 15, 2008 4:17 PM in response to Jirka Cech

Ah, I was confused by, "which do have nice and proper ID3 tags" and assumed they were all fine.

Option: See if a program such as Media rage lets you do what you want. It has all kinds of tag editing features but some of them take a bit of learning.

Option: Do rename your files using renamer and re-import them.

Or maybe the script the other poster provided does what you want.

Nov 15, 2008 4:19 PM in response to Jirka Cech

I don't know how your playlists are set up, so I am guessing that you still have (or can replace) the "Recently Added" smart playlist. You will probably need to edit the parameters to get the number of your new additions, but try this:

<pre style="
font-family: Monaco, 'Courier New', Courier, monospace;
font-size: 10px;
margin: 0px;
padding: 5px;
border: 1px solid #000000;
width: 720px;
color: #000000;
background-color: #FFDDFF;
overflow: auto;"
title="this text can be pasted into the Script Editor">
tell application "iTunes"
set MyList to (get tracks of playlist "Recently Added")

repeat with SomeTrack in MyList
set TheName to the name of SomeTrack
try -- strip a track number prefix if it exists
get (the first word of TheName) as number -- "words" are delimiter sensitive
set the name of SomeTrack to text (word 2) thru -1 of TheName
end try
end repeat
end tell
</pre>

Nov 16, 2008 6:46 AM in response to Jirka Cech

When you get "words" of something, the text is broken up along non-word boundaries, which includes whitespace and various punctuation marks such as a period or dash. Getting the words of "123.whatever name" results in word 1 being "123" and word 2 being "whatever" (completely skipping the period). Then it is just a matter of testing the first word to see if it is a number, and getting the rest of the text from the second word on if it is.

Rename multiple iTunes songs

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.