File Name of iTunes Track

Hi folks. Anybody know how to get the filename of a track in a playlist?

I tried getting the location of it and splitting on “:”, but that didn’t work.

tell application "iTunes"
	set myplaylist to "tunes_test"
	set TrackLocations to location of every file track of playlist myplaylist
	set myt to the first item in TrackLocations as text

	set oldDelimiters to AppleScript's text item delimiters
	set AppleScript's text item delimiters to ":"
	set wordlist to text items of myt as text
	set AppleScript's text item delimiters to oldDelimiters
	log wordlist
	-- set wordlist to tokenize the first item in TrackLocations with delimiters {":"}

end tell

I’m repairing a script and I can’t seem to build a shell script that uses both the current source path and the target modified path. I replace the latter with some characters omitted.

Any insight appreciated. Cheers

The line

 set wordlist to text items of myt as text

splits the text and joins it at once because of the as text coercion. Delete it

 set wordlist to text items of myt

The file name is the last text item