Question about Tell Blocks, my Handlers and "Tell"ing inside handlers

In working thru this post: https://macscripter.net/viewtopic.php?id=46469
I did discover that I needed to “re” Tell iTunes inside of my handler:

tell application "iTunes"
	set sel to selection
	if sel is not {} then
		repeat with aTrack in sel
			my customHandler(aTrack)
		end repeat
	else
		set thePlaylist to view of the front browser window
		repeat with i from 1 to (index of last track of thePlaylist)
			set aTrack to track i of thePlaylist
			my customHandler(aTrack)
		end repeat
	end if
end tell

on customHandler(aTrack)
	tell application "iTunes" --//I had to add this to make it work
		tell aTrack
			try
				-- do stuff with aTrack via iTunes commands
			end try
		end tell
	end tell --//I had to add this to make it work
end customHandler


Is there anyway to call a handler of me but still have the item passed be reffering to
it’s original class?

something like:

set result to my customHandler(it's aTrack)

or within the handler


on customHandler(aTrack)
	tell it's aTrack
		try
			-- do stuff with aTrack via iTunes commands
		end try
	end tell
end customHandler

thanks

Hi. The handler instance has no concept of terms not found in its dictionary. You can implement a “using terms from application …” block, but it’s typically easier to just direct calls to the application.