Go Back   MacRumors Forums > iPhone, iPod and iPad > iPod

Thread Tools Search this Thread Display Modes
Old Dec 27, 2008, 02:40 AM   #1
macrumors 603
richard.mac's Avatar
Join Date: Feb 2007
Location: 51.50024, -0.12662
Send a message via Skype™ to richard.mac
batch change track number, artist/s name, song name from track name with script?

is there a way to batch change the track name in the format "track number - artist/s - song name" and fill out their respective correct fields with an AppleScript or Workflow or anything? i tried searching Doug's AppleScripts but cant find anything that would help me.

e.g. 01 - Dizzee Rascal Feat. Calvin Harris And Chrome - Dance Wiv Me

Name: Dance Wiv Me
Artist: Dizzee Rascal Feat. Calvin Harris And Chrome
Track Number: 1
If you can't innovate, you just imitate, but it's never quite as good as the original.
Hackintosh - Core i5 4670K, Z87X, 7870XT, 16GB RAM, 128GB SDD | MacBook Air 13" 2013 | iPhone 6 16GB JB
richard.mac is offline   0 Reply With Quote
Old Mar 4, 2009, 01:26 AM   #2
macrumors newbie
Join Date: Mar 2009
Applescript to batch rename tracks

I had the same problem. After hunting around for various scripts, I finally bought a copy of Stern's book on iTunes hacks and found mostly what I was looking for.

Below is my own customized script that does the batch renaming for files whose title tags are in the form "001 - Artist Name - Song Title" and splits the string and populates the appropriate tags for each song.

To use this script, cut and paste text below to a text file and save it to a file "rename.sctpd" in your Library/iTunes/Scripts folder. Then highlight the tracks you want to auto-rename and invoke the script from the script menu.

I hope this helps.

(* batch renaming script for iTunes
James Kuffner
March 3, 2009

Splits iTunes tracks titled as "001 - Artist Name - Song Title" into
the respective track number, artist, and title fields
property separator : " - "
property my_title : "Split Delimited Title into Track, Artist, Title"

tell application "iTunes"
if selection is not {} then -- if tracks are selected...
set sel to selection
set numTracks to (length of sel)
set s to "s"
if numTracks is 1 then set s to ""
display dialog "parse and split the title name text into artist field and track field." & return & return & (numTracks & " track" & s & " selected.") buttons {"Cancel", "Continue"} default button 2 with title my_title giving up after 30
if gave up of result is true then return

set oldfi to fixed indexing
set fixed indexing to true

repeat with aTrack in selection
tell aTrack
if name contains separator then
set {track number, artist, name} to my text_to_list(name, separator)
end if
end tell
end repeat

set fixed indexing to oldfi
display dialog "No tracks have been selected." buttons {"Cancel"} default button 1 with icon 0 giving up after 30
end if -- no selection
end tell

on text_to_list(txt, delim)
set saveD to AppleScript's text item delimiters
set AppleScript's text item delimiters to {delim}
set theList to every text item of txt
on error errStr number errNum
set AppleScript's text item delimiters to saveD
error errStr number errNum
end try
set AppleScript's text item delimiters to saveD
return (theList)
end text_to_list
jkuff is offline   0 Reply With Quote
Old May 6, 2009, 06:07 AM   #3
macrumors newbie
Join Date: Mar 2009
script now broken after iTunes 8.1.1 update


It appears that after Apple released the recent iTunes update (8.1.1) the script I posted above no longer works. (*sigh* - why does Apple do this?)

If I get it working again, I will post the new version. But I thought I would warn those of you who have the latest iTunes and are having trouble with this script.

jkuff is offline   0 Reply With Quote
Old May 6, 2009, 06:25 AM   #4
macrumors 6502a
Join Date: Feb 2008
What is the difference in changing song info this way and going into iTunes and highlighting the tracks that you want to change and right clicking, get info? Then filling adding the info/album art you want. I have been doing it this way for years without any problem. I have moved my music between several different computers and the info always transfers over with the correct info and album art.

I don't know much about script so that is why I am asking.
15.4" UMBP 32gb Iphone 4 16gb 3G iPad 30gb iPod Video iPod Shuffle 2G
Once you go Mac, you never go back...
JCastro is offline   0 Reply With Quote
Old May 6, 2009, 06:49 AM   #5
macrumors newbie
Join Date: Mar 2009

The script is useful because you don't want to have to manually change hundreds (or in my case, thousands) of songs by hand. Believe me, after manually changing about 20 songs, you will rapidly succumb to exhaustion.

Anyway, it turns out that the script still works fine if you run it directly from the Script Editor (not from within iTunes 8.1.1).

jkuff is offline   0 Reply With Quote
Old Mar 28, 2010, 02:16 PM   #6
macrumors Westmere
Join Date: May 2008
I know the thread is old, but Track Parser v1.3.1 from Doug's AppleScripts for iTunes does exactly what the OP wants.
GGJstudios is offline   0 Reply With Quote

MacRumors Forums > iPhone, iPod and iPad > iPod

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
Track by reference number?? Lyons00 iPhone 2 Sep 20, 2013 08:09 AM
Question About How to Change Audio Track to Match Movie Track (Video Inside) flipster Digital Video 3 Jun 8, 2012 01:02 AM

Forum Jump

All times are GMT -5. The time now is 02:35 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2015, MacRumors.com, LLC