No internet connection
  1. Home
  2. How to

Select Track Names using keywords

By Andrew Downes @Andrew_Downes
    2020-04-20 03:08:29.993Z

    I would like to be able to select tracks by using keywords instead of having to have the exact track name.
    for example instead of having to have Guitar 1, Guitar 2 etc, is it possible to just have the word Guitar and have any track with that word in it be selected. I am trying to avoid having to have every possibility of a track name listed just so I can change the input or output of a track.
    Thanks

    • 1 replies
    1. Yes certainly!

      You can for example use regular expressions to filter on the track names like this:

      var trackNames = sf.ui.proTools.trackNames.filter(n => n.match(/(Guitar|Gtr|Gt)/i));
      
      sf.ui.proTools.trackSelectByName({
          names: trackNames,
          deselectOthers: true,
      });
      

      This should select all tracks containing the word "guitar", "gtr" or "gt" (case-insensitive)