No internet connection
  1. Home
  2. How to

Coalesce VCA automation

By Thomas Gloor @Thomas_Gloor
    2022-04-01 09:45:15.106Z

    Hi!

    I'm facing a weird issue with a small script I wrote, that was working perfectly until I changed a tiny thing. But for the life of me, I can't figure out what's going on.

    In my PT mix template, I HAD 3 VCA's called respectively ALL LEADS VCA, ALL BVS VCA and ALL MUSIC VCA.

    I wrote a script for each one of the VCA's that did the following:

    //Remember original track i was working on.
    //Go to ALL LEADS VCA
    //Open ALL LEADS VCA popup menu and select Coalesce VCA Master Automation
    //Scroll to and select the track i was working on.

    For visual reasons (display on my controllers), I renamed the 3 VCA's respectively vALL LEADS, vALL BVS and vALL MUSIC

    I replaced the names in the script, but it doesn't work anymore. All it does is go from the track I was working on to the VCA and back to the track I was working on without coalescing the VCA.

    Any idea? Here's one of the scripts.

    Thank you very much!

    //Remember original track i was working on.
    var originalTrackName = sf.ui.proTools.selectedTrackNames[0];
    
    //Go to ALL LEADS VCA
    sf.ui.proTools.trackGetByName({ name: "vALL LEADS", makeVisible: true }).track.trackScrollToView();
    
    //Open ALL LEADS VCA popup menu and select Coalesce VCA Master Automation
    sf.ui.proTools.menuClick({
        menuPath: ["Track","Coalesce VCA Master Automation"],
    });
    
    //Scroll to and select the track i was working on.
    sf.ui.proTools.trackSelectByName({ names: [originalTrackName] })
    sf.ui.proTools.selectedTrack.trackScrollToView();
    
    • 13 replies
    1. Try adding this before the menuClick:

      sf.ui.proTools.appActivateMainWindow();
      

      or

      sf.keyboard.press({ keys: 'left' });
      

      This will force PT to update its menu items to reflect the newly selected track.

      1. TThomas Gloor @Thomas_Gloor
          2022-04-01 15:07:06.525Z

          Hey Christian,

          Thank you so much for answering. I tried both, but it doesn't work.

          Any other idea?

          1. Hm. Try stopping the script right after the menuClick (or before). As in, just remove the rest of the script temporarily. Then double check if the menu item is indeed available and check what happens if you run it yourself (manually click it)

            1. TThomas Gloor @Thomas_Gloor
                2022-04-01 15:16:03.103Z

                I just tried. It actually doesn't perform the menu click apparently

                1. Can you share the scripts you tested with where you had inserted the key presses?

                  And what you're saying is that when you click it manually, it works?

                  1. It's possible PT needs even more time to make the menu item ready before it'll react to the menu click (after the track has been selected). But it's news to me if the hacks I showed you aren't enough to make it update the menu correctly.

                    1. TThomas Gloor @Thomas_Gloor
                        2022-04-01 15:21:16.554Z

                        Yes it works when I click to open the menu, and coalesce.

                        To only thing that change, is the name of the VCA's, and I've replaced it in the script. It's crazy!

                      • In reply tochrscheuer:
                        TThomas Gloor @Thomas_Gloor
                          2022-04-01 15:20:40.870Z

                          There:

                          //Remember original track i was working on.
                          var originalTrackName = sf.ui.proTools.selectedTrackNames[0];
                          
                          //Go to ALL LEADS VCA
                          sf.ui.proTools.trackGetByName({ name: "vALL LEADS", makeVisible: true }).track.trackScrollToView();
                          
                          //KEY PRESSES WERE HERE
                          
                          //Open ALL LEADS VCA popup menu and select Coalesce VCA Master Automation
                          sf.ui.proTools.menuClick({
                              menuPath: ["Track","Coalesce VCA Master Automation"],
                          });
                          
                          //Scroll to and select the track i was working on.
                          sf.ui.proTools.trackSelectByName({ names: [originalTrackName] })
                          sf.ui.proTools.selectedTrack.trackScrollToView();
                          
                          
                          1. Christian Scheuer @chrscheuer2022-04-01 15:44:23.251Z2022-04-01 15:58:12.603Z

                            Hm ok, then I don't really have an idea.

                            Edit: Honestly, it sounds a bit more like a PT bug if this works for some tracks and not others :/

                            1. TThomas Gloor @Thomas_Gloor
                                2022-04-02 06:42:52.238Z

                                Thank you Chris.
                                Hey might be. It’s super weird though…

                  2. T
                    In reply toThomas_Gloor:
                    Tony David Cray @tdc
                      2022-04-02 01:37:19.321Z

                      Hi @Thomas_Gloor,

                      I had a few moments before a recording here today and tried out your script, everything worked as expected with your original script. I created some volume automation on the VCA track, then some trim passes, then your script to Coalesce. All worked fine.

                      This system is PT 2021.12, mbp M1 Max, macOS 12.1

                      1. TThomas Gloor @Thomas_Gloor
                          2022-04-02 06:43:36.611Z

                          Thank you for trying!
                          I’ll post if I figure it out

                        • T
                          In reply toThomas_Gloor:
                          Thomas Gloor @Thomas_Gloor
                            2022-04-02 10:41:53.750Z

                            SO...
                            Don't ask me why, as it didn't work yesterday. But I added (again) the following line

                            //Force PT to update its menu items to reflect the newly selected track.
                            sf.keyboard.press({ keys: 'left' });
                            

                            And it works fine now!

                            Thank you all for your precious help