iTunes add lack of error?

Hi, I am using the iTunes add function to import music to an iTunes playlist.

I am trying to enclose the add into a try so if there is an error I can have it record the error and copy the file to a failed to import directory along with an appended log file.

The problem I am running into is that even if I try to import a text document or picture file I am not getting any errors.

If I leave off the try and do just the ‘add’ I get the reply of

tell application “iTunes”
add “Macindosh HD:Test:test.rtf” to playlist “Library”
end tell

without any errors. Is there a different way I can script this to trigger an error and be able to use the on error function?

Any help is greatly appreciated, thanks!

Hi. I’d just check for something that would normally exist. Inedible items won’t have a kind, for instance. If you are using a string path, the naming must be exact; you misspelled Macintosh in your sample code.

tell application "iTunes"
	try
		(add "Macintosh HD:Test:test.rtf" to playlist "Library")'s kind
	on error
		beep
	end try
end tell

Thanks for the reply!
Yeah, the path was just typed in since I couldnt copy paste (im posting on a different computer)

The modified script works perfect!
It beeps when it fails and doesnt beep when I put in an mp3 =)

You rock!