No internet connection
  1. Home
  2. How to
  3. Logic Pro

Select track by name

By Matthew Brabender @Matthew_Brabender
    2024-06-14 13:18:03.322Z

    Howdy hey

    I’m wondering if it’s possible to select a track by name?
    I know it’s possible to select tracks by type (audio, aux etc), but this selects all tracks of the chosen type. However, I’m trying to set up quick navigations buttons to jump to specific tracks.

    The use case is I set up sessions with folder stacks (drums, bass, guitars, keys , buses, fx etc). When mixing on a controller, it would be super handy to have buttons to hit that selects the vca for each folder stack (removing the need to grab the mouse).

    • 6 replies
    1. This should do it.
      Just make a copy for each track you want to select / scroll to, change the value of trackPreset, and assign the scripts to keyboard triggers or Stream Deck button:

      const trackName = "Audio 5"
      
      sf.ui.proTools.appActivate()
      
      sf.ui.proTools.trackSelectByName({
          names:[trackName]
      })
      
      sf.ui.proTools.selectedTrack.trackScrollToView()
      
      1. Chris Shaw @Chris_Shaw2024-06-14 18:13:09.520Z2024-06-14 18:27:14.367Z

        This version will select the track and scroll the track to the very top of the edit window .

        const trackName = "Audio 5"
        
        sf.ui.proTools.appActivate()
        
        function csScrollToTrack(trackNames) {
            const menuClickScrollToTrack = () => sf.ui.proTools.menuClick({ menuPath: ['Track', 'Scroll to Track...'] })
            var confirmationDialogWin = sf.ui.proTools.confirmationDialog;
            var scrollTrack = (typeof trackNames == "object") ? trackNames[0] : trackNames;
            
            try {
                menuClickScrollToTrack();
        
                confirmationDialogWin.elementWaitFor({ timeout: 100 });
        
            } catch (err) {
                sf.keyboard.press({ keys: "n", repetitions: 2, fast: true });
        
                menuClickScrollToTrack();
        
                confirmationDialogWin.elementWaitFor({}, `Could not find Scroll to track Dialog`);
            }
        
            confirmationDialogWin.textFields.first.elementSetTextFieldWithAreaValue({
                value: scrollTrack,
                useMouseKeyboard: true
            });
        
            confirmationDialogWin.buttons.whoseTitle.is('OK').first.elementClick();
        
            confirmationDialogWin.elementWaitFor({ waitType: 'Disappear' });
        };
        
        csScrollToTrack(trackName)
        
        1. In reply toChris_Shaw:
          DDave Weingarten @Dave_Weingarten
            2025-02-20 02:04:24.787Z2025-02-20 02:20:09.107Z

            Hey Chris, thank you for this. I'm wondering if there's a way to select multiple tracks at the same time. And possibly skip the tracks it can't find...

          • Matthew Brabender @Matthew_Brabender
              2024-06-14 23:41:24.884Z

              Thanks so much Chris, much appreciated. Do you know if this will work in Logic if I just change the app name in the script?

              1. Matthew Brabender @Matthew_Brabender
                  2024-06-15 06:43:03.347Z

                  Played with it a bit but it doesn’t seem that function is available in Logic. I wondering if there’s another way to find a track by name

                  1. My bad.
                    I didn’t notice that this was a Logic question.