No internet connection
  1. Home
  2. How to

Show Insert Automation line

By Tomás Frias @Tomas_Frias
    2021-03-25 11:27:55.950Z

    Hi forum,

    I'm writing in order to know if it is possible to create a shortcut to show automation line of insert number 1.

    Example: "Reduction" automation line of RX Voice De-Noise, in slot number 1 of insert

    Thanks for your attention,
    Best regards
    Tomás Frias

    Solved in post #5, click to view
    • 7 replies
    1. samuel henriques @samuel_henriques
        2021-03-25 19:08:32.175Z2021-03-25 22:53:15.829Z

        Coméquié @Tomas_Frias,

        Try this, it will do it for all selected tracks:

        function showAutomationLanes() {
            //If any automation lane for selected tracks are hidden, show them.
            const showAutomationLaneBtn = sf.ui.proTools.selectedTrack.children.whoseTitle.is('Show/hide automation lanes').first;
            if (showAutomationLaneBtn.value.invalidate().value !== "Selected") {
                showAutomationLaneBtn.mouseClickElement({
                    isShift: true,
                    isOption: true,
                });
            } else {
                showAutomationLaneBtn.mouseClickElement();
                showAutomationLaneBtn.mouseClickElement({
                    isShift: true,
                    isOption: true,
                });
            }
        }
        
        
        function main() {
        
            //  Axctivate Pro Tools
            sf.ui.proTools.appActivate()
            //Invalidate Pro Tools main window.
            sf.ui.proTools.mainWindow.invalidate();
        
            //Get selected tracks
            const originalTracks = sf.ui.proTools.selectedTrackNames;
        
            //Show automation Lanes
            showAutomationLanes();
        
            //Do for each track.
            sf.ui.proTools.selectedTracks.trackHeaders.slice().map(track => {
        
                //Select track
                track.trackSelect();
        
                //Scroll track into View
                track.trackScrollToView();
        
                //Fetch track title
                let selectedTrackTitle = track.title.invalidate().value;
        
                //Fist automation lane on selected track
                let automationLane = sf.ui.proTools.mainWindow.children.whoseTitle.endsWith("Automation Lane").filter(f => f.title.invalidate().value.indexOf(selectedTrackTitle) === 0)[0];
        
                //   const currentVisibleLane = automationLane.popupButtons.whoseTitle.is('Lane view selector').first.value.invalidate().value;
        
                //String to identify sends and setting
                const insertIndentifier = '(fx a)';
                const settingName = 'Reduction'
        
                if (automationLane.popupButtons.whoseTitle.is('Lane view selector').first.value.invalidate().value !== settingName) {
                    let a = automationLane.popupButtons.whoseTitle.is('Lane view selector').first.popupMenuSelect({
                        menuSelector: items => items.filter(item => item.path[0].indexOf(insertIndentifier) >= 0 && item.path.indexOf(settingName) >= 0)[0],
                        onError: 'Continue',
                    });
        
                }
            });
        
            //Restore previously selected tracks
            sf.ui.proTools.trackSelectByName({ names: originalTracks });
            sf.ui.proTools.selectedTrack.trackScrollToView();
            sf.ui.proTools.trackSelectByName({ names: originalTracks });
        }
        
        
        
        main();
        
        1. samuel henriques @samuel_henriques
            2021-03-25 22:52:58.214Z

            UPDATED: made improvements to ease change of insert or setting

            1. TTomás Frias @Tomas_Frias
                2021-03-26 10:23:32.305Z

                Hi Samuel,

                thanks a lot for your help, it works!
                Anyway is there any option to show the automation line in the track and not the "lane" if you know what I mean.

                Thanks again for your help

                Tomás Frias.

                1. samuel henriques @samuel_henriques
                    2021-03-26 10:46:02.038Z

                    hahaha, sorry I read line as lane,

                    Here you go:

                    function main() {
                    
                        //  Axctivate Pro Tools
                        sf.ui.proTools.appActivate()
                        //Invalidate Pro Tools main window.
                        sf.ui.proTools.mainWindow.invalidate();
                    
                        //Get selected tracks
                        const originalTracks = sf.ui.proTools.selectedTrackNames;
                    
                        //Do for each track.
                        sf.ui.proTools.selectedTracks.trackHeaders.slice().map(track => {
                    
                            //Select track
                            track.trackSelect();
                    
                            //Scroll track into View
                            track.trackScrollToView();
                    
                            //Fetch track title
                            let selectedTrackTitle = track.title.invalidate().value;
                    
                            // Automation view popup
                            const automationView = sf.ui.proTools.selectedTrack.popupButtons.allItems[2]
                    
                            //String to identify sends and setting
                            const insertIndentifier = '(fx a)';
                            const settingName = 'Reduction'
                    
                            if (automationView.invalidate().value.value !== settingName) {
                                let a = automationView.popupMenuSelect({
                                    menuSelector: items => items.filter(item => item.path[0].indexOf(insertIndentifier) >= 0 && item.path.indexOf(settingName) >= 0)[0],
                                    onError: 'Continue',
                                });
                            }
                        });
                    
                        // //Restore previously selected tracks
                        sf.ui.proTools.trackSelectByName({ names: originalTracks });
                        sf.ui.proTools.selectedTrack.trackScrollToView();
                        sf.ui.proTools.trackSelectByName({ names: originalTracks });
                    }
                    
                    
                    
                    main();
                    

                    the last step selects the original selected tracks, if you don't need those, just delete them. It'll make the script faster.
                    this bit:

                        // //Restore previously selected tracks
                        sf.ui.proTools.trackSelectByName({ names: originalTracks });
                        sf.ui.proTools.selectedTrack.trackScrollToView();
                        sf.ui.proTools.trackSelectByName({ names: originalTracks });
                    

                    hope this is it

                    ReplySolution
                    1. TTomás Frias @Tomas_Frias
                        2021-03-26 10:50:29.579Z

                        WOW!

                        Samuel it works like magic hahaha.
                        Thanks a lot Master!!

                        1. samuel henriques @samuel_henriques
                            2021-03-26 11:04:01.243Z

                            Great,
                            Just to clarify, I'm just a young padawan, the Master is Kitch.
                            And Christian is Yoda! Hahah!

                            1. TTomás Frias @Tomas_Frias
                                2021-03-26 11:08:34.225Z

                                I can only say, may the force be with you!