No internet connection
  1. Home
  2. How to

Is it possible to select the Pro Tools parent routing folder of the currently selected track

By Richard Davey @Richard_Davey
    2023-03-27 13:12:38.252Z

    I work a lot in routing folders, with tracks inside those folders having processing, but also the routing folders themselves having processing. I'd love to know if there's a way to select the parent folder of whatever routing folder i'm working.

    For example, a macro that would select the routing folder that my track is in (tracks are always underneath their parent folder), then to open an insert or a send or whatever of that parent folder.

    Any tips greatly received. Thank you.

    • 3 replies
    1. J
      JF Sauvé @JF_Sauve
        2024-09-23 18:56:36.020Z

        I'd really like the same. Even just for soloing the parent folder instead on it clicking.

        1. Chad Wahlbrink @Chad2024-09-24 19:50:09.386Z

          Hi @JF_Sauve,

          This script should allow you to select the parent folder of the currently selected Track:

          
          if (!sf.ui.proTools.isRunning) throw `Pro Tools is not running`;
          
          sf.ui.proTools.appActivateMainWindow();
          sf.ui.proTools.mainWindow.invalidate();
          
          let parentTrackPath = sf.ui.proTools.selectedTrack.titleButton.popupMenuFetchAllItems({ isRightClick: true, })
              .menuItems.filter(x => x.path.includes('Move to...')).filter(x => !x.element.isEnabled)[0].path;
          
          sf.keyboard.press({ keys: 'escape' });
          
          let parentTrackName = parentTrackPath[parentTrackPath.length - 1].split('-').pop();
          
          const ptVersion = sf.ui.proTools.appVersion.split('.').map(Number).slice(0, 2).reduce((p, c, i) => p + Math.pow(100, 2 - i) * c, 0);
          // const ptVersion = 230600
          if (parentTrackName !== 'Top Level') {
              if (ptVersion < 230900) {
                  // Non-SDK
                  sf.ui.proTools.trackSelectByName({ names: [parentTrackName], deselectOthers: true });
          
              } else {
                  // SDK Version
                  sf.app.proTools.selectTracksByName({ trackNames: [parentTrackName], });
              }
          }
          
          1. Chad Wahlbrink @Chad2024-09-24 19:51:20.961Z

            To solo the parent folder, you can do the following:

            if (!sf.ui.proTools.isRunning) throw `Pro Tools is not running`;
            
            sf.ui.proTools.appActivateMainWindow();
            sf.ui.proTools.mainWindow.invalidate();
            
            let parentTrackPath = sf.ui.proTools.selectedTrack.titleButton.popupMenuFetchAllItems({ isRightClick: true, })
                .menuItems.filter(x => x.path.includes('Move to...')).filter(x => !x.element.isEnabled)[0].path;
            
            sf.keyboard.press({ keys: 'escape' });
            
            let parentTrackName = parentTrackPath[parentTrackPath.length - 1].split('-').pop();
            
            const ptVersion = sf.ui.proTools.appVersion.split('.').map(Number).slice(0, 2).reduce((p, c, i) => p + Math.pow(100, 2 - i) * c, 0);
            // const ptVersion = 230600
            
            if (parentTrackName !== 'Top Level') {
                if (ptVersion < 230900) {
                    // Non-SDK
                    sf.ui.proTools.trackSelectByName({ names: [parentTrackName], deselectOthers: true });
            
                    sf.ui.proTools.selectedTrack.trackSetSolo({targetValue:"Enable"});
            
                } else {
                    // SDK Version
                    sf.app.proTools.selectTracksByName({ trackNames: [parentTrackName], });
                    
                    sf.app.proTools.setTrackSoloState({enabled: true, trackNames:[parentTrackName] });
                }
            }