No internet connection
  1. Home
  2. How to

Show Pan Automation line in Selected Track

By Martin Pavey @Martin_Pavey
    2019-09-09 16:39:53.884Z2019-09-10 03:15:38.800Z

    I'm trying to make a shortcut which does the above, I've got as far as this:

    sf.ui.proTools.selectedTrack.popupButtons.whoseTitle.is('Track View selector').first.elementClick();
    

    This opens the pop up and the next thing I would usually do is type 'pan' to move to the pan.
    I've tried to add a script that types pan, but it doesn't work.
    Is there a more elegant way to do this?

    Thanks

    Solved in post #2, click to view
    • 10 replies
    1. Hi @Martin_Pavey.

      The way to do this would be to use the popupMenuSelect action, like this:

      sf.ui.proTools.selectedTrack.popupButtons.whoseTitle.is('Track View selector').first.popupMenuSelect({
          menuPath: ['pan']
      });
      

      In fact we have an even shorter way of doing it with the trackDisplaySelect action which wraps the above call:

      sf.ui.proTools.selectedTrack.trackDisplaySelect({
          displayPath: ['pan']
      });
      
      ReplySolution
      1. MMartin Pavey @Martin_Pavey
          2019-09-10 11:38:30.295Z

          Very nice, thanks Christian.
          I added a return at the end to make it work on a track routed to a surround bus to show the L lane.

          sf.ui.proTools.selectedTrack.trackDisplaySelect({
          displayPath: ['pan']
          });
          sf.keyboard.press({
          keys: "return",
          });

          There's probably a better way to do it but it works for me.

          1. That works - you could also do this for 5.1 tracks:

            sf.ui.proTools.selectedTrack.trackDisplaySelect({
                displayPath: ['pan', 'front pos']
            });
            
            1. MMartin Pavey @Martin_Pavey
                2019-09-10 21:48:42.778Z

                Oh wow, its that easy to get to sub menus!
                Love it.
                M

                1. In reply tochrscheuer:
                  GGray Aletter @Gray_Aletter
                    2022-11-18 21:48:04.748Z

                    Hey @chrscheuer . This is great! Wondering if it's possible to script it so it does the same but with whatever tracks you have selected (like how "-" will cycle between volume automation and waveform for ALL selected tracks. Thx!

                    1. Yes :)

                      sf.ui.proTools.selectedTrack.trackDisplaySelect({
                          displayPath: ['pan', 'front pos'],
                          selectForAllSelectedTracks: true,
                      });
                      

                      I'd highly recommend checking out how to build this via macros first, then it's easy to click "Convert to Script". You can also click "Suggest" while between the { and } of an action to see the parameters available.

                      This has more details:

                      https://soundflow.org/docs/how-to/custom-commands/using-code-completion

                      1. GGray Aletter @Gray_Aletter
                          2022-11-19 11:46:53.364Z

                          Incredible. I was able to create a macro by understanding your code!

                          I know the attachment below is incorrect but I'm trying to figure out how to create an "if" statement within the macro.

                          Basically want to press "CMD -" to open pan and then IF pan view is open, if you press again it takes you back to waveform.

                          Is there a way to do this within macro view?

                          1. You can't do "if" logic yet in macros (but we'll add that in a future release)

                2. In reply toMartin_Pavey:
                  Mike Wax @mikewax
                    2022-02-08 23:20:04.645Z

                    This is brilliant!!

                    Would there be a way to show plug-in automation?

                    1. Hey Mike,

                      The displayPath property just takes the menu "path" from the popup menu where you select what to show. So you can get it to show anything from that menu.