iTunes and multiple finder selections

Hi, I’m trying to write a little applescript to do some conversion automation with iTunes. Unfortunately I’m stuck at the very beginning.

I just want to add a multiple selection from a finder window to a certain playlist.

Here’s my attempt:

tell application "Finder"
	set theSelection to selection as alias list
	tell application "iTunes"
		add theSelection to playlist "Convert"
	end tell	
end tell

I read in some forums, that the “add” command supports single aliases AND alias lists, but i keep getting this error on executing the script:

However, the script works if I make a single selection and leave away the word “list” in the third line of the script.

Does anyone know what I’m doing wrong?


Since OS 9 days -I think-, “as alias list” is not working properly. Try this:

tell application "Finder"
	set theSelection to selection
	--> convert theSelection to a real "alias list"
	repeat with i from 1 to count theSelection
		set theSelection's item i to theSelection's item i as alias
	end repeat
end tell

--> iTunes blah

Nice, this worked!