No internet connection
  1. Home
  2. How to

Choose a Track Preset Within the Output>New Track Dialog

By Philip weinrobe @Philip_weinrobe
    2023-05-31 15:29:27.022Z

    Hi Geniuses of Soundflow!
    I have a command that opens the "new track..." option from the Track Output drop down menu.
    It works! It is this

    sf.ui.proTools.selectedTrack.groups.whoseTitle.is("Audio IO").first.popupButtons.allItems[1].popupMenuSelect({
        menuPath: ["new track..."],
        isShift: true,
        isOption: true,
    });
    

    the next step i can't seem to figure out:
    I want to automatically select a specific track preset from within this pop up window
    @raphaelsepulveda has some great tools to access track presets and even create new tracks with track presets, but none of them allow me to call those scripts within this specific pop-up window.

    My overall goal is:

    1. Select An Existing Track
    2. Route It's Output to a New Track with a specific Track Preset selected.

    If this works through the "new track..." output menu, it will auto create all the busses/namings properly.

    Anyone help?
    Thank you!
    philip

    • 7 replies
    1. Hey @Philip_weinrobe, thanks for checking out my utilities! I'll make a note to include this type of functionality.
      In the meantime, here's a script that will do what you're looking for. Make sure to change the menuPaths to your desired track preset.

      /** @param {{ menuPath1: string[], menuPath2: string[] }} args */
      function outputNewTrackWithTrackPreset({ menuPath1, menuPath2 }) {
          const newTrackWin = sf.ui.proTools.windows.whoseTitle.is("New Track").first;
      
          sf.ui.proTools.appActivateMainWindow();
      
          sf.ui.proTools.selectedTrack.groups.whoseTitle.is("Audio IO").first.popupButtons.allItems[1].popupMenuSelect({
              menuPath: ["new track..."],
              isShift: true,
              isOption: true,
          });
      
          newTrackWin.elementWaitFor();
      
          newTrackWin.popupButtons.first.popupMenuSelect({
              menuPath: menuPath1
          });
      
          newTrackWin.popupButtons.allItems[1].popupMenuSelect({
              menuPath: menuPath2
          });
      
          newTrackWin.buttons.whoseTitle.is("Create").first.elementClick();
          newTrackWin.elementWaitFor({ waitType: "Disappear" });
      
          sf.ui.proTools.mainWindow.invalidate();
      }
      
      outputNewTrackWithTrackPreset({
          menuPath1: ["Track Presets", "Avid", "Channel Strips"],
          menuPath2: ["Elec Guitar"]
      });
      
      1. PPhilip weinrobe @Philip_weinrobe
          2023-06-07 23:12:07.290Z

          working great!

        • U
          In reply toPhilip_weinrobe:
          Udi Simhon @Udi_Simhon
            2024-03-10 19:24:33.733Z

            Hi @raphaelsepulveda

            Speaking of track presets...

            Can you please adjust this script to add a new track from scratch out of those track presets:?
            menuPath1: ["Track Presets", "Avid", "0_BF"],
            menuPath2: ["Master 1"]
            Thanks!

            1. Chad Wahlbrink @Chad2024-03-11 16:52:14.777Z

              Hey @Udi_Simhon !

              First, to tweak the original script to Output to a New Track with a Track Preset with your desired settings, I would tweak the script like this:

              /** @param {{ menuPath1: string[], menuPath2: string[] }} args */
              function outputNewTrackWithTrackPreset({ menuPath1, menuPath2 }) {
                  const newTrackWin = sf.ui.proTools.windows.whoseTitle.is("New Track").first;
              
                  sf.ui.proTools.appActivateMainWindow();
              
                  sf.ui.proTools.selectedTrack.groups.whoseTitle.is("Audio IO").first.popupButtons.allItems[1].popupMenuSelect({
                      menuPath: ["new track..."],
                      relativePosition: { x: 2, y: 2 },
                      isShift: true,
                      isOption: true,
                  });
              
                  newTrackWin.elementWaitFor();
              
                  newTrackWin.popupButtons.first.popupMenuSelect({
                      relativePosition: {x:5, y:5},
                      menuPath: menuPath1
                  });
              
                  newTrackWin.popupButtons.allItems[1].popupMenuSelect({
                      relativePosition: {x:5, y:5},
                      menuPath: menuPath2
                  });
              
                  newTrackWin.buttons.whoseTitle.is("Create").first.elementClick();
                  newTrackWin.elementWaitFor({ waitType: "Disappear" });
              
                  sf.ui.proTools.mainWindow.invalidate();
              }
              
              outputNewTrackWithTrackPreset({
                  menuPath1: ["Track Presets", "Avid", "0_BF"],
                  menuPath2: ["Master 1"]
              });
              

              ↑ This is just swapping the menuPath1 and menuPath2 fields in the original script.

              1. In reply toUdi_Simhon:
                Chad Wahlbrink @Chad2024-03-11 16:55:53.334Z

                Secondly, here is the script to Create a New Track with a track preset from scratch.

                
                /** @param {{ menuPath1: string[], menuPath2: string[] }} args */
                function createNewTrackWithTrackPreset({ menuPath1, menuPath2 }) {
                    const newTracksWin = sf.ui.proTools.windows.whoseTitle.is("New Tracks").first;
                
                    sf.ui.proTools.appActivateMainWindow();
                
                    sf.ui.proTools.menuClick({ menuPath: ['Track', 'New...'], });
                
                    newTracksWin.elementWaitFor();
                
                    newTracksWin.popupButtons.allItems[1].popupMenuSelect({
                        relativePosition: { x: 5, y: 5 },
                        menuPath: menuPath1,
                    });
                
                    newTracksWin.popupButtons.whoseDescription.is("Track format").first.elementWaitFor({ waitType: "Disappear" });
                
                    sf.ui.proTools.windows.whoseTitle.is("New Tracks").first.popupButtons.first.popupMenuSelect({
                        relativePosition: { x: 5, y: 5 },
                        menuPath: menuPath2,
                    })
                
                    newTracksWin.buttons.whoseTitle.is("Create").first.elementClick();
                    newTracksWin.elementWaitFor({ waitType: "Disappear" });
                
                }
                
                createNewTrackWithTrackPreset({
                    menuPath1: [
                        "Track Presets",
                        "Avid",
                        "0_BF"
                    ],
                    menuPath2: ["Master 1"]
                });
                

                ↑ This requires us to treat a few items differently. First, the UI window is New Tracks instead of New Track, and the New Tracks dialog has a few more fields to account for.

                1. In reply toUdi_Simhon:
                  Chad Wahlbrink @Chad2024-03-11 16:59:22.675Z
                2. U
                  In reply toPhilip_weinrobe:
                  Udi Simhon @Udi_Simhon
                    2024-03-11 21:44:21.437Z

                    Thanks @Chad !!
                    That was incredibly helpful!