No internet connection
  1. Home
  2. Packages
  3. EuControl

is there a script that i can assign a selected track in pro tools to a specified fader number

By randy matuszewski @randy_matuszewski
    2023-01-27 17:59:25.174Z

    @chrscheuer is there a way to adapt the code and have the fader number be variable?

    thanks!!

    Solved in post #11, click to view
    • 11 replies
    1. S
      SoundFlow Bot @soundflowbot
        2023-01-27 17:59:25.909Z

        Thanks for posting a question or an issue related to the 'EuControl' package.
        This package is made by @chrscheuer. We're auto-tagging them here so that they will hopefully be able to help you.

        Please note, that the best way to get help with a script, macro or other content installed from the Store is to select the script you installed, then click the red Need help button, and then click "Get help with this script or macro".
        By using this workflow, the developer of the package will get access to more information so they'll be able to help you quicker.
        You can read more about how to best get help in this article: bit.ly/sfscripthelp

        1. Hi Randy,

          I'm not sure I understand - could you elaborate a bit on this?

          1. i'm currently using your script to assign selected tracks in PT to my S1. i'm curious if it could be adapted to say, select a track in PT, and then have a script to assign it to fader 3 or fader 6 or assign it to any fader number of my choice.

            my goal would be to create buttons on my streamdeck that would be like "assign to fader 1", "assign to fader 2", "assign to fader 3", etc and then i can select the track i want in PT and then run the code to assign to the fader number i want.

            1. Oh, I see! That would be a nice workflow indeed.
              That should be fairly easy to implement.

              1. i'm curious if this is still planned to be added or if there is any progress on this?

                thanks so much!!

                1. I don't have a EUCON device here to test with, but try this:

                  
                  function assignSelectedTrackToFader(faderNum) {
                      var faderIndex = faderNum - 1;
                  
                      var eucon = sf.ui.app('com.Euphonix.EuControl');
                      eucon.appActivate();
                      eucon.getMenuItem("Window", "EuControl Settings").elementClick();
                  
                      var win = eucon.windows.whoseTitle.is('EuControl Settings').first;
                      win.elementWaitFor();
                  
                      //Switch to Assign tab
                      win.tabGroups.first.radioButtons.whoseTitle.is('Assign').first.elementClick();
                      win.tabGroups.first.checkBoxes.whoseTitle.is('Display Application\'s Track Numbers').first.elementWaitFor();
                  
                      //Clear existing assignments
                      win.tabGroups.first.buttons.whoseTitle.is('Clear All Assignments').first.elementClick();
                  
                      //Init
                      var table = win.tabGroups.first.scrollAreas.first.tables.first;
                      var rows = table.childrenByRole("AXRow").allItems;
                      var selectedTrackName = sf.ui.proTools.selectedTrackNames[0];
                  
                      //Assign tracks
                      var row = rows[faderIndex];
                      if (!row || !row.exists) throw `Couldn't find fader ${faderNum}`;
                  
                      //Select row
                      var cells = row.children.allItems;
                      cells[cells.length - 1].popupMenuSelect({
                          menuPath: [selectedTrackName]
                      });
                  }
                  
                  assignSelectedTrackToFader(1);
                  

                  You can change the fader number to assign the selected track to in the last line.

                  1. this works PERFECTLY!! thanks so much!

                    1. In reply tochrscheuer:

                      i've tried to add a close window to the end of this. any chance you can help me with that add-on?

                      i REALLY appreciate your time and effort.

                      1. Something like this should do it (not tested though):

                        
                        function assignSelectedTrackToFader(faderNum) {
                            var faderIndex = faderNum - 1;
                        
                            var eucon = sf.ui.app('com.Euphonix.EuControl');
                            eucon.appActivate();
                            eucon.getMenuItem("Window", "EuControl Settings").elementClick();
                        
                            var win = eucon.windows.whoseTitle.is('EuControl Settings').first;
                            win.elementWaitFor();
                        
                            //Switch to Assign tab
                            win.tabGroups.first.radioButtons.whoseTitle.is('Assign').first.elementClick();
                            win.tabGroups.first.checkBoxes.whoseTitle.is('Display Application\'s Track Numbers').first.elementWaitFor();
                        
                            //Clear existing assignments
                            win.tabGroups.first.buttons.whoseTitle.is('Clear All Assignments').first.elementClick();
                        
                            //Init
                            var table = win.tabGroups.first.scrollAreas.first.tables.first;
                            var rows = table.childrenByRole("AXRow").allItems;
                            var selectedTrackName = sf.ui.proTools.selectedTrackNames[0];
                        
                            //Assign tracks
                            var row = rows[faderIndex];
                            if (!row || !row.exists) throw `Couldn't find fader ${faderNum}`;
                        
                            //Select row
                            var cells = row.children.allItems;
                            cells[cells.length - 1].popupMenuSelect({
                                menuPath: [selectedTrackName]
                            });
                        
                            win.windowClose();
                        }
                        
                        assignSelectedTrackToFader(1);
                        
                        ReplySolution
                        1. perfect!! TYSM

            2. S
              SoundFlow Bot @soundflowbot
                2023-01-27 18:48:02.690Z

                This issue is now tracked internally by SoundFlow as SF-750