Correct way to delete iTunes 7 song?

Hi there,

I have an action that suddenly doesn’t work with iTunes version 7. The action takes iTunes songs as input. Here’s a simplified version of the action:

on run {input, parameters}
	repeat with myTrack in input
		-- do some stuff
		tell application "iTunes" to delete myTrack
	end repeat
end run

This worked in iTunes 6, but with iTunes 7 I get something like “file track X of playlist Y of source Z… doesn’t understand the delete message”. If I change the delete line to…


	tell application "iTunes"
		set dbID to database ID of myTrack
		delete (some track of playlist "Library" whose database ID is dbID)
	end tell

…it works fine in iTunes 7. However, I don’t like hard-coding the “Library” and it’ll probably break on non-English systems. What’s the preferred way of deleting the track in the case?

Thanks in advance,
Joachim

Thanks, Jacques. Just want I needed - works like a charm.