How to manage ID3 Tag using Applescript only?

Hey Guys,

I’m making a Filemaker DB to store all MP3 files that i have with locating, name, size of the file, and all the ID3 Tags.
I’m having a problem here, i need to get all of my MP3s ID3 tags using just AS and only AS and put in Filemaker DB.

I don’t want to use any other softwares like Itunes or so to help me with that. I’ve serached the forum and don’t found anything about that…

This is possible, like show a dialog asking for the paths of those files that i want to change the ID3 Tag and show me another dialog to put the new ID3 tags and them change it??

Can anyone help me with this issue??

Thanx a lot

Andre Tozzini

Hi tozzini,

What you can do is query musicbrainz.org for the id3 info. For more info:

http://musicbrainz.org/

Here’s an example script I wrote a while back just as a reminder to myself on how to do it.


tell application "iTunes"
	set lib_pl to first library playlist
	set first_track to first track of lib_pl
	set trk_info to {}
	set end of trk_info to artist of first_track
	set end of trk_info to album of first_track
end tell
set {ar, al} to trk_info
set ar to ReplaceText(ar, space, "+")
set al to ReplaceText(al, space, "+")
set the_url to "http://musicbrainz.org/ws/1/release/?type=xml&artist=" & ¬
	ar & "&title=" & al & "&limit=1&inc=counts"
do shell script ¬
	"curl " & quoted form of the_url
--
on ReplaceText(t, s, r)
	set utid to AppleScript's text item delimiters
	set AppleScript's text item delimiters to s
	set temp_list to text items of t
	set AppleScript's text item delimiters to r
	set temp_text to temp_list as string
	set AppleScript's text item delimiters to utid
	return temp_text
end ReplaceText

Through http it gets xml data.

result:
“<?xml version=\"1.0\" encoding=\"UTF-8\"?><metadata xmlns="http://musicbrainz.org/ns/mmd-1.0#\” xmlns:ext="http://musicbrainz.org/ns/ext-1.0#\“><release-list count="3" offset="0"><release id="0d40a571-4891-4d22-80ca-8874b15db311" type="Compilation Official" ext:score="100">Donovan’s Greatest HitsB00000ICNY<artist id="72d7d717-0837-4f2a-9641-d0f9fdd3acf7">Donovan<disc-list count="2"/><track-list count="15"/>”

You then parse the xml. Here, I was just trying to get the track count if I remember right.

gl,

Thanx a lot Kel,

But what i really want is not to use Itunes for this… i hope that is some way that can help me using maybe AS or any bash script or so…

I have a lot of MP3 files in a folder on the Desktop, for example, and i want to have a dialog box that ask me the path of those MP3 files and them pick up the id3 tags for each file and insert into my DB. Just that, i dont want to use any program to pick the ID3 tag…

Anyway, thanx a lot…

Andre Tozzini

Hi tozzini,

It doesn’t use iTunes. I just used iTunes to get an example track information to query musicbrainz to see if it works.

BTW, as I said it has been a while, so I was searching for the page with the information on how to write the url. Found it:

http://wiki.musicbrainz.org/XMLWebService

I’m not sure how you can use this to get some of the id3 information and need to review that page.

gl,

Kel,

Maybe i couldnt explain what i really want. I dont want to get the ID3 tag from the musicboard.org, i just want to get the id3 that is already in those files and insert into a database that i already made.

Those Mp3 files had already the Id3 tags, i just want to figure out how i can get this id3 tag from those mp3 files and insert the info into my Database.

Maybe i could explain better… i dont know…

Thanx again…

AndreTozzini

Hi tozzini,

From your first post, it sounded like you wanted to change the id3 tags. I think Apple added some things to the OS for reading id3 tags from files, but can’t respond on that.

gl,