No internet connection
  1. Home
  2. How to

(PT) Change height of selected tracks to "micro" (or other...)

By Stepan Sevastyanov @Stepan_Sevastyanov
    2019-09-27 01:12:29.381Z

    Hi there! Can you help me to do this feature with Soundflow 3?

    • Change height of selected tracks to one of the default presets. For example, "micro".
      Maybe it would be useful to do this with combination of modifier with numbers... 1 for micro ... 7 for extreme, 0 for fit in window etc.

    Thanks a lot for the support!

    Solved in post #2, click to view
    • 18 replies
    1. Hi Stepan.

      This script would give you the height "small" for the selected track:

      var size = 'small';
      
      var f = sf.ui.proTools.selectedTrack.frame;
      var popupMenu = sf.ui.proTools.selectedTrack.popupMenuOpenFromElement({
          relativePosition: { x: f.w - 10, y: 5 },    
      }).popupMenu;
      popupMenu.menuClickPopupMenu({
          menuPath: [size]
      });
      

      I would recommend using the built in shortcuts for this though (cmd+scroll wheel to zoom in/out)

      Reply1 LikeSolution
      1. Thanks, Christian!

        The script works for first track of selected tracks. It seems that I'll wait for "for all slected tracks, do" function to improve this script in future.

        Actually I havent used default shortcuts (cmd+scroll wheel to zoom in/out). I just gave it a try and it seems handy! I'll put it into my workflow.

        Thanks a lot — you are so kind answering all those questions and helping optimising all these post-pro workflows, which sometimes can be really time-consuming... :)))

        1. Thank you for the kind words :)
          Here's a script that'll work for all selected tracks:

          var size = 'small';
          
          var f = sf.ui.proTools.selectedTrack.frame;
          var popupMenu = sf.ui.proTools.selectedTrack.popupMenuOpenFromElement({
              relativePosition: { x: f.w - 10, y: 5 },    
              isOption: true,
              isShift: true,
          }).popupMenu;
          popupMenu.menuClickPopupMenu({
              menuPath: [size]
          });
          
          1. BBruno Tarrière @Bruno_Tarriere
              2020-09-17 11:17:37.814Z

              Hello Christian,

              That's great, I'm looking for a small adjustment that is not obvious.

              Actually in the right size in my session is between small and medium. (which I adjust manually) But I don't know, as this size is called in protools, it's not in the context menu... Maybe small-medium ?

              1. SoundFlow would have a hard time adjusting track heights by simulating mouse clicks/drags in a stable way - although you could certainly try. Generally, if you want SF to automate something, the first step is to list the manual actions you'd take.
                How exactly do you adjust the size manually today? If it's with the mouse, I'd consider it hard to reach for a stable macro.
                If you're using the keyboard (ctrl+alt+up/down) then you could just add that keyboard simulation event to the script.

              2. In reply tochrscheuer:

                For some reason this doesn't work on Instrument tracks.
                Is there a workaround?

                1. In reply tochrscheuer:
                  Kitch Membery @Kitch2021-05-05 19:12:40.708Z

                  Hi @Cesar_Sogbe,

                  Great to see you in the webinar today.

                  As requested... Here is a script Christian posted to set the track heights of all selected tracks.

                  Hope that helps.
                  Rock on!

                  1. CCesar Sogbe @Cesar_Sogbe
                      2021-05-05 19:24:43.126Z

                      Thank You Kitch! You guys rock!!

              3. Just to throw in my two cents:
                Here's a script that will cycle through three sizes (small, medium, large) each time you trigger the script.
                If you want to add or use different sizes just modify the sizes array by adding or deleting the sizes you prefer.

                I use this script a lot when I 'm editing vocals and automation

                sf.ui.proTools.appActivate();
                var sizes = ['small', 'medium', 'large'];
                
                if (globalState.csTrackSize == undefined) { globalState.csTrackSize = 1 };
                globalState.csTrackSize++;
                if (globalState.csTrackSize >= sizes.length) { globalState.csTrackSize = 0 };
                try {
                    var f = sf.ui.proTools.selectedTrack.frame;
                    var popupMenu = sf.ui.proTools.selectedTrack.popupMenuOpenFromElement({
                        relativePosition: { x: f.w - 10, y: 5 },
                        isOption: true,
                        isShift: true,
                    }).popupMenu;
                    popupMenu.menuClickPopupMenu({
                        menuPath: [sizes[globalState.csTrackSize]]
                    });
                } catch (err) { };
                
                1. This is awesome and seemingly bomb proof Chris, thanks! So, I have a really dumb question that I know there's any easy answer to script, but I'm beyond NOOB to scripting so I have no idea WHERE in your script I'd put it. Where and how in this script would I put (HOLD DOWN OPTION) so that this script triggers on ALL TRACKS.

                  Thanks!
                  Owen

                  1. Depends.
                    How are you triggering this script?
                    Stream Deck or Keyboard? If keyboard what key combination are you using to trigger it?

                    1. It's very easy if you're using a stream deck or surface:
                      just replace

                      isShift: true
                      

                      With:

                      isShift: (event.keyboardState.hasAlt) ? false : true,
                      
                      1. Triggering on stream deck.

                        1. Nifty! Thanks!

                  2. In reply toChris_Shaw:
                    CCesar Sogbe @Cesar_Sogbe
                      2021-09-01 18:22:05.354Z

                      Thank You Chris!

                      1. In reply toChris_Shaw:
                        EEli Crews @Eli_Crews
                          2024-03-21 14:44:54.531Z

                          This seems to have broken in PT 2024.3, any chance you know how to fix it? Running SF 5.7.5, thanks!

                          1. Hi Eli,

                            This has been addressed in a few other threads:

                            1. EEli Crews @Eli_Crews
                                2024-03-21 15:32:37.919Z

                                Great, thanks, sorry I missed it