iTunes selection

hello all,

I have an applescript that adds information to the lyrics field of an mp3 file.

It currently works on whichever file is selected in iTunes. It opens iTuunes, then opens the first file, adds lyric info, then saves the file.

I want to batch process all the songs in my iTunes library.

How do I make aplescript automatically select the next song in iTunes once I have processed the currently selected mp3?

(i.e applescript opens iTunes processes selected song, then moves on to process the next song, then the next etc…)

Your help is greatly appreciated!

Thanks,
Steve

Ciao Steve,
the selection property of iTunes returns a list of selected tracks.
Once you have created this list you loop through the contained tracks and do something with these tracks, for example

tell application "iTunes"
	set s to selection
	repeat with aTrack in s
		set n to name of aTrack
		display dialog n
	end repeat
end tell

Good scripting
Farid

Hi Steve,

this is difficult, because the next song in the list you see is not unconditionally the next song
in the library of iTunes. I would write a script processing a selection of tracks,
which is more reliable.

Take a look at Doug Adams’ huge collection of AppleScripts,
maybe you dont’t have to reinvent the wheel :wink:

http://www.dougscripts.com/itunes/