Macro to Remove Tracks

Hello,

I have a project with 14 tracks in it.

I would like a macro to delete all of the tracks except for track 3 and 11.

I can’t seem to find any information on how to do this.

Your help would be greatly appreciated.

Thanks

SelectTracks:Mode="Set" Track="0" TrackCount="2"
SelectTracks:Mode="Add" Track="3" TrackCount="7"
SelectTracks:Mode="Add" Track="11" TrackCount="3"
RemoveTracks:

Keep in mind that your first track is track 0 in Audacity, not track 1 - I think!

Should TrackCount=“4” be TrackCount=“3”? Just wondering.

Yes, but it won’t do any harm. If there is a “track 15”, it will be deleted.
I’ll correct it to avoid confusion.

Done.

Thanks for these hints. I’m trying to do a similar thing. I start with a baby step: select track 4 (partly to check whether numbering starts from 0 or 1). In the parameter of the saved macro the track number to select keeps reverting to 0. (Which seems to confirm that the first track is numbered 0, since, when I apply it, the first track gets selected.)

Why can’t I select track 4?

Also, I don’t understand what the mode means. Why, when selecting, should I choose Set, Add, or Remove?

(I had assumed I would first select a track or tracks and then delete in a separate step. Is that wrong?)

I’d be grateful for pointers and hope it’s OK to reply to a semi-ancient thread.

Cheers, Tim