How to remove a track with Lua

I’m looking for a way to remove a selected track in a Lua script.
I found Editor:remove_tracks() but can’t figure out, how to use it.
I thought, maybe something like Editor:get_selection().tracks:remove_tracks() would work, but - you guessed it - it won’t.
Someone’s got an idea, how i can achieve this?

The only way I know to remove routes at all is Editor:access_action("Editor", "remove-track") which removes the selected route(s). It’s invoking the Track > Remove menu action and therefore also shows the confirmation dialog.

Editor:access_action() often saves the day for me. When there’s something I can do manually via menus but can’t find any way with the Lua API.

1 Like

Awesome, you are my hero again! :wink:

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.