No internet connection
  1. Home
  2. How to

Assigning multiple tracks to two outputs?

By william wittman @william_wittman
    2022-06-28 23:45:01.374Z

    I'm using this script to assign a track to two output buses.

    But IS there a way to do this to all selected tracks instead of only to one?

    thanks!

    sf.ui.proTools.appActivateMainWindow();

    sf.ui.proTools.selectedTrack.outputPathButton.popupMenuSelect({
    menuPath: ["bus", "MIX BUS (Stereo)"]
    });

    sf.ui.proTools.selectedTrack.outputPathButton.popupMenuSelect({
    isControl: true,
    menuPath: ["bus", "rear (Stereo)"]
    });

    • 5 replies
    1. Ben Rubin @Ben_Rubin
        2022-06-29 14:35:23.728Z

        William,

        I found this script somewhere on this forum. (I did not write it.) But it works great for me in tons of situations.

        /** @param {{ action: function }} arg */
        function doForEachSelectedTrack({ action }) {
            sf.ui.proTools.appActivateMainWindow();
            sf.ui.proTools.mainWindow.invalidate();
        
            const selectedTracksNames = sf.ui.proTools.selectedTracks.names;
        
            sf.ui.proTools.trackDeselectAll();
        
            selectedTracksNames.forEach(selectedTrackName => {
                sf.ui.proTools.trackSelectByName({ names: [selectedTrackName] });
                action(selectedTrackName);
                sf.ui.proTools.mainWindow.invalidate();
            });
        }
        
        doForEachSelectedTrack({
            action: selectedTrackName => {
                // Insert the actions you'd like to perform on every track here!!
            }
        });
        

        best,
        b

        1. william wittman @william_wittman
            2022-06-29 15:25:31.302Z

            Thanks. Will give it a go!

            1. Ben's solution will work but it will make the assignments one track at a time. (But the script is really useful in other situations).
              This will do them all at once:

              //Activate and Invalidate Main window
              sf.ui.proTools.appActivateMainWindow();
              
              sf.ui.proTools.mainWindow.invalidate();
              
              // Get selected track Names
              const selTrackNames = sf.ui.proTools.selectedTrackNames
              
              // Select first track and ensure it is visible / scrolled in Edit window
              sf.ui.proTools.trackSelectByName({ names: [selTrackNames[0]] })
              
              sf.ui.proTools.selectedTrack.trackScrollToView()
              
              // Reselect originally selected tracks
              sf.ui.proTools.trackSelectByName({ names: selTrackNames })
              
              // Assign outputs
              sf.ui.proTools.selectedTrack.outputPathButton.popupMenuSelect({
                  menuPath: ["bus", "MIX BUS (Stereo)"],
                  isShift: true,
                  isOption: true
              });
              
              sf.ui.proTools.selectedTrack.outputPathButton.popupMenuSelect({
                  isShift: true,
                  isOption: true,
                  isControl: true,
                  menuPath:  ["bus", "rear (Stereo)"]
              });
              
              1. william wittman @william_wittman
                  2022-06-29 18:04:02.215Z2022-07-02 04:32:12.854Z

                  @Chris_Shaw

                  Thanks Chris.

                  And ‘hi’!

                  1. In reply toChris_Shaw:
                    Ben Rubin @Ben_Rubin
                      2022-06-30 13:25:16.893Z

                      thanks for this, @Chris_Shaw!