Hi!
Have started to learn how to make Reascripts with Lua,
and is now at a point there I smack my head against the
wall. I am trying to save some selected tracks GUIDS to
a table but get an error I dont understand - maybe its
the hot summer...
My code:
Code:
function SaveSelectedTracksGUID ()
-- Get the number of selected tracks in the project
number_of_selected_tracks = reaper.CountSelectedTracks(0)
selected_tracks_table = {} -- init table
for i = 0, number_of_selected_tracks do -- collect selected track
tr = reaper.GetSelectedTrack(0, i)
Msg(tr)
track_guid = reaper.GetTrackGUID( tr )
Msg(track_guid)
--Store this tracks GUID to end of table
selected_tracks_table[#selected_tracks_table + 1] = track_guid
Msg(selected_tracks_table[i])
end
end
And the error is: bad argument #1 to 'GetTrackGUID' (MediaTrack expected)
I am doing something wrong - but what?
Have Googled but couldn't find any solution.
Anyone seeing what the problem is?
Regards
Thomas