View Single Post
Old 10-27-2020, 11:30 AM   #3
jkooks
Human being with feelings
 
Join Date: May 2020
Posts: 163
Default

Alternatively you can just use this:

Code:
message = ""
for i = 0, reaper.CountSelectedTracks(0) - 1 do
	local thisTrack = reaper.GetSelectedTrack(0, i)
	local trackIndex = tostring(reaper.GetMediaTrackInfo_Value(thisTrack, "IP_TRACKNUMBER")):gsub("%.0", "")
	local retval, trackName = reaper.GetTrackName(thisTrack)

	message = message .. trackIndex .. " = " .. trackName .. "\n" --displays the actual track number (i.e. it is track #2 out of every track)
	-- message = message .. i+1 .. " = " .. trackName .. "\n" --displays the selected track number (i.e. it is the second selected track)
end

if message:len() > 0 then reaper.ShowMessageBox("Selected Track Names:\n\n" .. message, "Selected Track Names", 0) end
jkooks is offline   Reply With Quote