No internet connection
  1. Home
  2. How to

Toggle Show/Hide Automation Lanes

By Benjamin Lecuyer @benjaminlecuyer
    2020-03-27 15:45:55.373Z

    I am looking for years for a way to have a shortcut who toggle 'track automation lanes'.
    I found how to Change Automation Line on the Selected Track but it is not enough, I have plenty of automation line prepared on each track.

    Macbook Pro 16', i9 8-Core 2.4ghz, 32gb ram, Catalina 10.15.4, Pro Tools Ultimate 2019.12.0

    Solved in post #2, click to view
    • 11 replies
    1. Hi Benjamin,

      You can toggle "Show automation lanes" on the selected track with this:

      sf.ui.proTools.selectedTrack.children.whoseTitle.is('Show/hide automation lanes').first.elementClick();
      

      Was this what you meant?

      Reply1 LikeSolution
      1. Benjamin Lecuyer @benjaminlecuyer
          2020-03-27 16:03:56.875Z

          Yessss !!!

          Amazing, Thank You very much!!

        • In reply tobenjaminlecuyer:
          Benjamin Lecuyer @benjaminlecuyer
            2020-04-04 20:56:32.128Z

            Hey Christian,

            I hope all is ok.

            Since the new Pro Tools 2020.3.0, this script is still working on tracks, but not on the new amazing 'folder tracks'.

            I saw the fonction in the script 'selectedTrack', I tried to change it with selectedFolder, Folder, and others but I am not skilled in coding so I prefere to ask you.

            Maybe it will work on a future version :).

            Thanks

            1. M
              In reply tobenjaminlecuyer:
              Martin Pavey @Martin_Pavey
                2020-04-08 12:56:26.815Z

                Ah ha!
                This is great!
                Would it be possible to expand on this and have a shortcut which opens all automation lanes, both on a selected track and all plugins on that track?
                Or even better, now that pro tools reports which lanes have active automation by changing the colour of the name, would it be possible to have a shortcut which only opens automation lanes with automation written on them?
                That's a thing I've wanted for years in Pro Tools and exists in other Daws.
                I realise it may be quite a hard thing to get to work, as there are so many variables.

                1. Hi Martin!

                  We could definitely have it expand specific automation lanes, but unfortunately we cannot currently read if the text is bold or not in the popup menu (which is the mechanism PT uses to signal which lanes have automation), so we can't get it to only expand those with automation on (unless we can get that info from elsewhere).

                  1. MMartin Pavey @Martin_Pavey
                      2020-04-08 15:10:14.555Z2020-04-09 18:41:03.113Z

                      Hi Christian,
                      I hope you're doing ok in these strange times.

                      I wanted to add to the script to add automation lanes by clicking the little plus symbol.
                      I tried this based on your script:

                      sf.wait(1000);
                      sf.ui.proTools.selectedTrack.whoseTitle.is('Add automation lane below this one').first.elementClick();
                      

                      but it doesn't work.

                      Is there a way to do that?
                      Thanks.

                      1. Hi Martin.

                        These two functions could help you make sure that all 4 automation lanes are shown:

                        function showAutomationLanes() {
                            function getLanes() {
                                return sf.ui.proTools.mainWindow.children.invalidate().whoseTitle.endsWith("Automation Lane").filter(f => f.title.value.indexOf(selectedTrackTitle) === 0);
                            }
                        
                            var selectedTrackTitle = sf.ui.proTools.selectedTrack.title.invalidate().value;
                        
                            var originalLaneCount = getLanes().length;
                            if (originalLaneCount == 0) {
                                sf.ui.proTools.selectedTrack.children.whoseTitle.is('Show/hide automation lanes').first.elementClick();
                        
                                var i = 0;
                                while (getLanes().length == originalLaneCount) {
                                    sf.wait({ intervalMs: 100 });
                                    if (++i >= 20) throw "Could not show automation lanes";
                                }
                            }
                        }
                        
                        function addAutomationLane() {
                            function getLanes() {
                                return sf.ui.proTools.mainWindow.children.invalidate().whoseTitle.endsWith("Automation Lane").filter(f => f.title.value.indexOf(selectedTrackTitle) === 0);
                            }
                        
                            var selectedTrackTitle = sf.ui.proTools.selectedTrack.title.invalidate().value;
                        
                            var lanes = getLanes();
                            var originalLaneLength = lanes.length;
                            if (originalLaneLength == 4) return false;
                            var i = 0;
                            while (lanes.length == originalLaneLength) {
                                var couldAdd = lanes.some(lane => {
                                    var addBtn = lane.children.whoseTitle.is('Add automation lane below this one').first;
                                    if (addBtn.exists) {
                                        addBtn.elementClick();
                                        return true;
                                    }
                                });
                                if (couldAdd) return true;
                                sf.wait({ intervalMs: 100 });
                                lanes = getLanes();
                                if (++i >= 20) throw "Could not add automation lane";
                            }
                        }
                        
                        showAutomationLanes();
                        addAutomationLane();
                        addAutomationLane();
                        addAutomationLane();
                        
                        1. Benjamin Lecuyer @benjaminlecuyer
                            2020-04-11 14:40:37.330Z

                            Hey Martin, Christian,

                            Martin, I have another way to do what you are looking for, maybe you would be interested in this, maybe not...

                            I found that I was automating always the same parameters during my mixes, so I simply prepare in advance all automation lanes I need for each track, and I use the script 'toggle automation lane'.

                            See You

                            1. MMartin Pavey @Martin_Pavey
                                2020-04-11 16:49:26.225Z

                                Thanks Christian,
                                It works, but when I use it it changes the plugin selection box to the old style grey one rather than the new black one.
                                The black one has the advantage that you can type the name of a plugin or send and it searches immediately, the grey one doesn't do that. I think I read about this issue on another thread?
                                The black one comes back after a re-boot.
                                I think I might just use Benjamin's method, it makes sense.
                                Thanks Guys.

                              • In reply tochrscheuer:
                                samuel henriques @samuel_henriques
                                  2020-08-22 11:20:35.871Z

                                  Hello Christian,
                                  Is there a way to adapt this to show only sends level?

                                  Thank you

                                  1. Hi Samuel
                                    Please start a new topic with your question and link to this one, as this thread is already closed. It's best if you can give us more information on exactly what you'd like, ie. do you want a script that just opens up a specific send lane, or all send lanes, etc.