No internet connection
  1. Home
  2. How to

Record enable all visible tracks

By Chris Testa @Chris_Testa
    2024-06-03 01:10:46.076Z

    Is there any macro out there for this? I have a window configuration that will just show my record tracks. Once I select that I just want everything that is visible to be record enabled. Is there a way to do that because I don't see. Maybe through a group?

    • 16 replies
    1. D
      danielkassulke @danielkassulke
        2024-06-03 08:29:23.765Z

        Hi Chris, something like this should work:

        const pT = sf.ui.proTools;
        pT.appActivateMainWindow();
        pT.mainWindow.invalidate();
        
        const visibleTrackNames = pT.visibleTrackNames;
        
        pT.trackSelectByName({ names: visibleTrackNames });
        
        const recEnable = pT.selectedTrack.buttons.whoseTitle.is("Track Record Enable").first;
        
        recEnable.mouseClickElement({
            anchor: "MidCenter",
            isShift: true,
            isOption: true
        });
        
        sf.ui.proTools.trackDeselectAll();
        
        1. CChris Testa @Chris_Testa
            2024-06-03 23:55:23.419Z

            Ok so I tried it. It goes down the list of all the tracks and selects them but I get an error before it pops them into record. Not sure if the folders make it an issue. I included a picture. Any thoughts? thanks

            1. Ddanielkassulke @danielkassulke
                2024-06-04 01:32:30.333Z

                Hi Chris,

                It looks like this is for a specific template. Does this template get used often? Is there a reason you wouldn't just record enable tracks directly by name?

                1. CChris Testa @Chris_Testa4
                    2024-06-04 01:36:58.302Z

                    Honestly I’m down to do it anyway I just want to add it to a script I have going so I can do it anyway that makes the most sense. And yes this is my normal print portion of my Atmos template

                    1. Ddanielkassulke @danielkassulke
                        2024-06-04 01:39:53.779Z

                        Are the comments within each print track spelled exactly the same as the track names?

                        1. CChris Testa @Chris_Testa
                            2024-06-04 01:48:44.231Z

                            they should be. If they aren't then that's a mistake.

                            1. Ddanielkassulke @danielkassulke
                                2024-06-04 01:51:49.480Z2024-06-04 02:03:57.512Z

                                There'll be someone smarter than me who offers the same functionality but in 2 lines, but I'd address the tracks by name directly, like this:

                                pT.appActivateMainWindow();
                                pT.mainWindow.invalidate();
                                
                                // TRACK NAMES GO HERE ↓
                                var desiredTrackNames = ["PRINTMASTER 5_1_L", "PRINTMASTER 5_1_C", "PRINTMASTER 5_1_R", "PRINTMASTER 5_1_LFE", "PRINTMASTER 5_1_Ls", "PRINTMASTER 5_1_Rs", "PRINTMASTER 2_0_L", "PRINTMASTER 2_0_R"];
                                
                                var trackNames = sf.ui.proTools.trackNames.filter(n => desiredTrackNames.includes(n));
                                
                                if (trackNames.length > 0) {
                                    sf.ui.proTools.trackSelectByName({ names: trackNames });
                                }
                                
                                const recEnable = pT.selectedTrack.buttons.whoseTitle.is("Track Record Enable").first;
                                
                                recEnable.mouseClickElement({
                                    anchor: "MidCenter",
                                    isShift: true,
                                    isOption: true
                                });
                                
                                sf.ui.proTools.trackDeselectAll();
                                
                                1. CChris Testa @Chris_Testa
                                    2024-06-04 02:11:12.151Z

                                    Right. It seems like such a simple thing and I know I can option click on all of them but I don't want to have to.

                                    1. In reply todanielkassulke:
                                      CChris Testa @Chris_Testa
                                        2024-06-04 02:12:00.244Z

                                        I'll definitely try this. I'll let you know. Thank you.

                                        1. CChris Testa @Chris_Testa
                                            2024-06-04 04:04:20.632Z

                                            That doesn't work unfortunately. I'm getting this... not sure if it helps or means anything...
                                            "<< Command: RECORD ENABLE [user:ckn9rrfcc00014y10wbej77h7:clwzvhbz60000l210iwkjv1w7]

                                            03.06.2024 21:02:56.52 [Backend]: [SF_FIREBASE_WS]: Sending keep-alive

                                            1. In reply toChris_Testa:

                                              Just in case, here is another option that will enable record on all audio tracks that are not hidden or inactive:

                                              // Get track names of audio tracks that are not hidden or inactive
                                              const trackNames = sf.app.proTools.tracks.invalidate().allItems
                                                  .filter(track =>
                                                      track.type === "Audio"
                                                      && !track.isHidden
                                                      && !track.isInactive
                                                  )
                                                  .map(track => track.name);
                                              
                                              // Enable record
                                              sf.app.proTools.setTrackRecordEnableState({
                                                  trackNames,
                                                  enabled: true
                                              });
                                              
                                              1. CChris Testa @Chris_Testa
                                                  2024-06-04 04:09:36.244Z

                                                  ok great. I just shut down but I'll try it in the morning. Thank you again for all your help.

                                2. C
                                  In reply toChris_Testa:
                                  Chris Testa @Chris_Testa4
                                    2024-06-03 16:48:44.421Z

                                    Great. I’ll try it soon. Thank You

                                    1. In reply toChris_Testa:

                                      If you're running PT 2024.3 or higher this script will record enable all visible, active audio tracks:

                                      sf.ui.proTools.appActivateMainWindow();
                                      
                                      const tracks = sf.app.proTools.tracks.invalidate().allItems;
                                      
                                      const allVisibleAudioTracks = tracks.filter(t => !t.isHidden && t.type == "Audio")
                                      
                                      const allActiveVisibleAudioTracksNames = allVisibleAudioTracks.filter(t => !t.isInactive).map(t => t.name)
                                      
                                      allActiveVisibleAudioTracksNames.forEach(name => {
                                          let track = sf.ui.proTools.trackGetByName({ name }).track
                                          track.buttons.whoseTitle.is("Track Record Enable").first.elementClick()
                                      })
                                      
                                      1. Oops, I see @raphaelsepulveda beat me to it!

                                        1. CChris Testa @Chris_Testa
                                            2024-06-04 19:38:43.467Z

                                            That worked. Thank you Chris! I was actually talking to a friend of mine yesterday who briefly worked with you at Greene St. back in the day. Thanks again. c