No internet connection
  1. Home
  2. How to

Toggle Folder Tracks Open/Closed

By J.R. Chappell @J_R_Chappell
    2022-02-01 21:34:50.959Z2022-02-02 09:41:46.547Z

    I tried this from the Sound Flow presets in track visibility. From what I can tell it only opens. It does not toggle open and closed. Am I missing something.

    if (!sf.ui.proTools.isRunning) throw `Pro Tools is not running`;
    
    sf.ui.proTools.appActivateMainWindow();
    
    sf.ui.proTools.selectedTrack.folderTrackSetOpen();
    
    • 5 replies
    1. Kitch Membery @Kitch2022-02-02 09:41:22.042Z

      Hi @J_R_Chappell,

      This should do the trick :-)

      if (!sf.ui.proTools.isRunning) throw `Pro Tools is not running`;
      
      sf.ui.proTools.appActivateMainWindow();
      
      sf.ui.proTools.selectedTrack.folderTrackSetOpen({targetValue:"Toggle"});
      
      1. J
        In reply toJ_R_Chappell:
        J.R. Chappell @J_R_Chappell
          2022-02-02 13:34:31.458Z

          Thanks Kitch,

          There is still something wrong.

          Here is my script

          sf.ui.proTools.trackSelectByName({
          names: ["AAF"],
          });

          if (!sf.ui.proTools.isRunning) throw Pro Tools is not running;

          sf.ui.proTools.appActivateMainWindow();

          sf.ui.proTools.selectedTrack.folderTrackSetOpen({targetValue:"Toggle"});

          When I run it is still opening the folder but not closing it and I get this error.

          Folder Open/Close state didn't update (Show AAFs Line 10)

          1. samuel henriques @samuel_henriques
              2022-02-02 16:38:07.174Z

              Could the track size be too small so the folder icon on the track is not visible?

            • J
              In reply toJ_R_Chappell:
              J.R. Chappell @J_R_Chappell
                2022-02-02 17:22:34.458Z

                Yes! That was it!

                Thank you sooo much

                1. samuel henriques @samuel_henriques
                    2022-02-02 21:17:27.141Z

                    If you really want, it's possible to write something to open/close the folder from the top left popup of the track, when the track so small the icon is hidden.