No internet connection
  1. Home
  2. How to

Question: what's the cleanest way to display all Group Globals in a template?

By Eric Huergo @Eric_Huergo
    2021-10-29 06:41:07.317Z

    Hello everyone, it's me yet again with hopefully not-too-newbie of a question!

    Anyhow, I'm trying to figure out what the most clean and efficient way of displaying all Group Globals in a template would be.

    I know I could make my script work by generating 60-ish Booleans that state whether or not, for example "Insert h Bypass" should be toggled on or off however, I can't help but feel that this is messy and cumbersome - not to mention time consuming to make/fill out. Sure, in theory this works but I feel like there must be a better way. Ideally I imagine something like a user-defined enum that looks like this:

    Title: Group Globals - Insert Controls Ticked On
    Description: Select which Insert Controls should be ticked on in Group Globals for this particular group.
    Type: User-Defined Enum
    Members: a,b,c,d,e,f,g,h,i,j

    The key thing I'm trying to communicate is that when it comes to selecting a member instead of only selecting one, I would like to be able to select multiple but present them neatly and not across 60+ lines.

    I can't help but feel like there's something I just don't know and that for this scenario using a user-defined enum isn't the best choice. This being said, I have no idea what the best choice could be and so far, my leading hypothesis is precisely that of creating those 60-ish booleans unless someone here happens to know a better way!

    Anyhow, I feel like it's a longshot and I might just end up having to bite the boolean bullet but I still think it's worth a shot to try and ask around and see if any of the code wizards might have a spell or two up their sleeve!

    Appreciate you taking the time to read this whether or not you're able to help!
    Much love, Eric.

    • 31 replies

    There are 31 replies. Estimated reading time: 44 minutes

    1. Kitch Membery @Kitch2021-10-30 02:23:11.879Z

      Hi @Eric_Huergo,

      This looks very complicated (needing 60+ boolean values stored in the global state), however that is possible. But let's try to look at it from a more simple perspective.

      What is it you are actually trying to achieve? (If you can explain this, I'm sure there is a solution that may not be as elaborate.)

      Also, from your post I'm not sure I understand what you mean by Group Globals, can you clarify this?

      Rock on!

      1. In reply toEric_Huergo:
        Eric Huergo @Eric_Huergo
          2021-10-30 03:48:09.009Z2021-10-30 21:09:01.097Z

          Hey @Kitch thanks for the response! Essentially, I'm trying to be able to define all of the tickboxes in the following dialog box from a template inside a package:

          I want to do this because I want to very quickly be able to fill out all of these values according to whatever settings a template states. This would make it so that I only have to define the values once per template and simply run the script whenever I want a particular set of values applied.

          I've done this already with a ton of booleans but to me that feels messy when I look at it in the template as there's one line per tickbox. What I'm trying to do is essentially, in an ideal scenario just have the following lines:

          Main Volume: y/n
          Main Mute: y/n
          Main Pan: y/n
          Main LFE: y/n
          Insert Controls: a,b,c,d,e,f,g,h,i,j
          Insert Bypass: a,b,c,d,e,f,g,h,i,j
          Send Level: a,b,c,d,e,f,g,h,i,j
          Send Mute: a,b,c,d,e,f,g,h,i,j
          Send Pan: a,b,c,d,e,f,g,h,i,j
          Send LFE: a,b,c,d,e,f,g,h,i,j
          Record Enable: y/n
          Input Monitoring: y/n
          Object Controls: y/n
          Solos: y/n
          Automation Mode: y/n

          My apologies if this is a tricky one but I appreciate you a lot for even trying to help! :)

          EDIT - Also, I'd like to add that if there is a way but it would be fairly complex to realize then even just pointing me in the right direction would be greatly appreciated! I'm not afraid of investing time into developing more proficient coding skills! Even though I'm not a complete newbie to coding/programming I'm well aware that there is still an incredible amount I have yet to learn and I think a big part of that is simply just becoming aware of what I don't know! So really, anything helps! Appreciate y'all! :)

          2nd EDIT - It's possible to save groups of desired configurations under the 6 "Settings" buttons but alas, that's not an ideal solution since it grants the user a fixed amount of 6 configurations, not to mention the user can't quickly see or name these configurations (which forces the user to remember that button 1 is the one used for x, button 2 is the one for y and so on)!

          1. Kitch Membery @Kitch2021-10-31 02:35:55.227Z

            Yeah that's a lot of Checkboxes to set up Template Boolean values for.

            I recon I have a solution for these;

            Insert Controls: a,b,c,d,e,f,g,h,i,j
            Insert Bypass: a,b,c,d,e,f,g,h,i,j
            Send Level: a,b,c,d,e,f,g,h,i,j
            Send Mute: a,b,c,d,e,f,g,h,i,j
            Send Pan: a,b,c,d,e,f,g,h,i,j
            Send LFE: a,b,c,d,e,f,g,h,i,j

            You can achieve this by using "String Arrays" within the Template page of the Command Template.

            Off the top of my head, I say the best way to deal with this would be to have a lookup table.

            Will mock something up this weekend. :-)

            Rock on!

            1. In reply toEric_Huergo:
              Kitch Membery @Kitch2021-10-31 02:37:44.708Z

              FYI... Here is how to create a "String Array" within the template.

              1. Eric Huergo @Eric_Huergo
                  2021-10-31 02:43:50.590Z

                  @Kitch, you're a saint. I genuinely appreciate the help far beyond what these ascii characters convey - There's real excited and happy emotion behind them so thank you, really!

                  I'm gonna have a go and see if I can figure it out right now and I'll post whatever I can come up with! Thank you!!!

                  1. Kitch Membery @Kitch2021-10-31 03:00:01.146Z

                    This could use a bit of refactoring but the idea is there.

                    const { insertControls, insertBypasses, sendLevels, sendMutes, sendPans, sendLfes } = event.props;
                    
                    
                    const groupWindowLookup = {
                        "a": { insertControl: 1, insertBypass: 0, sendLevel: 24, sendMute: 25, sendPan: 26, sendLfe: 27, },
                        "b": { insertControl: 3, insertBypass: 2, sendLevel: 28, sendMute: 29, sendPan: 30, sendLfe: 31, },
                        "c": { insertControl: 5, insertBypass: 4, sendLevel: 32, sendMute: 33, sendPan: 34, sendLfe: 35, },
                        "d": { insertControl: 7, insertBypass: 6, sendLevel: 36, sendMute: 37, sendPan: 38, sendLfe: 39, },
                        "e": { insertControl: 9, insertBypass: 8, sendLevel: 40, sendMute: 41, sendPan: 42, sendLfe: 43, },
                        "f": { insertControl: 11, insertBypass: 10, sendLevel: 44, sendMute: 45, sendPan: 46, sendLfe: 47, },
                        "g": { insertControl: 13, insertBypass: 12, sendLevel: 48, sendMute: 49, sendPan: 50, sendLfe: 51, },
                        "h": { insertControl: 15, insertBypass: 14, sendLevel: 52, sendMute: 53, sendPan: 54, sendLfe: 55, },
                        "i": { insertControl: 17, insertBypass: 16, sendLevel: 56, sendMute: 57, sendPan: 58, sendLfe: 59, },
                        "j": { insertControl: 19, insertBypass: 18, sendLevel: 60, sendMute: 61, sendPan: 62, sendLfe: 63, },
                    };
                    
                    function openModifyGroupGlobals() {
                        sf.ui.proTools.appActivateMainWindow();
                    
                        sf.ui.proTools.groupsEnsureGroupListIsVisible();
                    
                        sf.ui.proTools.windows.whoseTitle.is("Edit: TEST SESSION NOTES").first.buttons.whoseTitle.is("Group List pop-up").first.popupMenuSelect({
                            menuPath: ["Modify Groups"],
                        });
                    
                        sf.ui.proTools.windows.whoseTitle.is("Modify Groups").first.elementWaitFor();
                    
                        sf.ui.proTools.windows.whoseTitle.is("Modify Groups").first.radioButtons.whoseTitle.is("Globals 3 of 3").first.elementClick();
                    }
                    
                    /**
                     * @param {AxElement} window
                     * @param {Number} index
                     */
                    function setCheckbox(window, index, targetValue) {
                        switch (true) {
                            case targetValue === "Enable" && !window.checkBoxes[index].isCheckBoxChecked:
                                window.checkBoxes.whoseTitle.is("CheckBox").allItems[index].mouseClickElement();
                                break
                            case targetValue === "Disable" && window.checkBoxes[index].isCheckBoxChecked:
                                window.checkBoxes.whoseTitle.is("CheckBox").allItems[index].mouseClickElement();
                                break
                        }
                    }
                    
                    function setGroupGlobals() {
                        const modifyGroupsWin = sf.ui.proTools.windows.whoseTitle.is("Modify Groups").first;
                    
                        modifyGroupsWin.invalidate();
                    
                        let getDisabledCheckbox = (array) => "abcdefghij".split('').filter(cb => !array.includes(cb));
                    
                        //Set Insert Control Checkboxes
                        insertControls.forEach(insert => setCheckbox(modifyGroupsWin, groupWindowLookup[insert].insertControl, "Enable"));
                        getDisabledCheckbox(insertControls).forEach(insert => setCheckbox(modifyGroupsWin, groupWindowLookup[insert].insertControl, "Disable"));
                    
                        //Set insert Bypass Checkboxes
                        insertBypasses.forEach(insert => setCheckbox(modifyGroupsWin, groupWindowLookup[insert].insertBypass, "Enable"));
                        getDisabledCheckbox(insertBypasses).forEach(insert => setCheckbox(modifyGroupsWin, groupWindowLookup[insert].insertBypass, "Disable"));
                    
                        //Set Send Level Checkboxes
                        sendLevels.forEach(insert => setCheckbox(modifyGroupsWin, groupWindowLookup[insert].sendLevel, "Enable"));
                        getDisabledCheckbox(sendLevels).forEach(insert => setCheckbox(modifyGroupsWin, groupWindowLookup[insert].sendLevel, "Disable"));
                    
                        //Set Send Mute Checkboxes
                        sendMutes.forEach(insert => setCheckbox(modifyGroupsWin, groupWindowLookup[insert].sendMute, "Enable"));
                        getDisabledCheckbox(sendMutes).forEach(insert => setCheckbox(modifyGroupsWin, groupWindowLookup[insert].sendMute, "Disable"));
                    
                        //Set Send Pan Checkboxes
                        sendPans.forEach(insert => setCheckbox(modifyGroupsWin, groupWindowLookup[insert].sendPan, "Enable"));
                        getDisabledCheckbox(sendPans).forEach(insert => setCheckbox(modifyGroupsWin, groupWindowLookup[insert].sendPan, "Disable"));
                    
                        //Set Send LFE Checkboxes
                        sendLfes.forEach(insert => setCheckbox(modifyGroupsWin, groupWindowLookup[insert].sendLfe, "Enable"));
                        getDisabledCheckbox(sendLfes).forEach(insert => setCheckbox(modifyGroupsWin, groupWindowLookup[insert].sendLfe, "Disable"));
                    }
                    
                    setGroupGlobals();
                    
                    1. Kitch Membery @Kitch2021-10-31 03:01:43.348Z

                      Will take another swing at it asap :-)

                      But for now the command template looks like this;

                      Rock on legend!

                    2. In reply toEric_Huergo:
                      Kitch Membery @Kitch2021-10-31 03:03:46.363Z

                      Add whatever insert you want enabled, or leave out the one you want disabled :-)

                      The above will do this;

                      Rock on!

                      1. In reply toEric_Huergo:
                        Kitch Membery @Kitch2021-10-31 03:04:44.081Z

                        Gotta run... Dinner is ready :-)

                  2. In reply toEric_Huergo:
                    Eric Huergo @Eric_Huergo
                      2021-10-31 03:09:49.421Z

                      @Kitch, how in the actual f*** did you come up with this so fast? Absolute madlad!!!

                      Okay I definitely have some testing to do but holy sh**, mad respect and thank you so much yet again! I hope that dinner is incredibly tasty as you damn well deserve it!

                      WOW!

                      1. In reply toEric_Huergo:
                        Eric Huergo @Eric_Huergo
                          2021-10-31 04:15:38.877Z

                          Alright, so I modified the code a little bit (mainly just changed the window title "Edit: TEST SESSION NOTES" and renamed Lfes/Lfe to LFEs/LFE) like so:

                          const { insertControls, insertBypasses, sendLevels, sendMutes, sendPans, sendLFEs } = event.props;
                          
                          
                          const groupWindowLookup = {
                              "a": { insertControl: 1, insertBypass: 0, sendLevel: 24, sendMute: 25, sendPan: 26, sendLFE: 27, },
                              "b": { insertControl: 3, insertBypass: 2, sendLevel: 28, sendMute: 29, sendPan: 30, sendLFE: 31, },
                              "c": { insertControl: 5, insertBypass: 4, sendLevel: 32, sendMute: 33, sendPan: 34, sendLFE: 35, },
                              "d": { insertControl: 7, insertBypass: 6, sendLevel: 36, sendMute: 37, sendPan: 38, sendLFE: 39, },
                              "e": { insertControl: 9, insertBypass: 8, sendLevel: 40, sendMute: 41, sendPan: 42, sendLFE: 43, },
                              "f": { insertControl: 11, insertBypass: 10, sendLevel: 44, sendMute: 45, sendPan: 46, sendLFE: 47, },
                              "g": { insertControl: 13, insertBypass: 12, sendLevel: 48, sendMute: 49, sendPan: 50, sendLFE: 51, },
                              "h": { insertControl: 15, insertBypass: 14, sendLevel: 52, sendMute: 53, sendPan: 54, sendLFE: 55, },
                              "i": { insertControl: 17, insertBypass: 16, sendLevel: 56, sendMute: 57, sendPan: 58, sendLFE: 59, },
                              "j": { insertControl: 19, insertBypass: 18, sendLevel: 60, sendMute: 61, sendPan: 62, sendLFE: 63, },
                          };
                          
                          
                          function openModifyGroupGlobals() {
                              sf.ui.proTools.appActivateMainWindow();
                          
                              sf.ui.proTools.groupsEnsureGroupListIsVisible();
                          
                              sf.ui.proTools.mainWindow.buttons.whoseTitle.is("Group List pop-up").first.popupMenuSelect({
                                  menuPath: ["Modify Groups"],
                              });
                          
                              sf.ui.proTools.windows.whoseTitle.is("Modify Groups").first.elementWaitFor();
                          
                              sf.ui.proTools.windows.whoseTitle.is("Modify Groups").first.radioButtons.whoseTitle.is("Globals 3 of 3").first.elementClick();
                          }
                          
                          
                          /**
                           * @param {AxElement} window
                           * @param {Number} index
                           */
                          function setCheckbox(window, index, targetValue) {
                              switch (true) {
                                  case targetValue === "Enable" && !window.checkBoxes[index].isCheckBoxChecked:
                                      window.checkBoxes.whoseTitle.is("CheckBox").allItems[index].mouseClickElement();
                                      break
                                  case targetValue === "Disable" && window.checkBoxes[index].isCheckBoxChecked:
                                      window.checkBoxes.whoseTitle.is("CheckBox").allItems[index].mouseClickElement();
                                      break
                              }
                          }
                          
                          function setGroupGlobals() {
                              const modifyGroupsWin = sf.ui.proTools.windows.whoseTitle.is("Modify Groups").first;
                          
                              modifyGroupsWin.invalidate();
                          
                              let getDisabledCheckbox = (array) => "abcdefghij".split('').filter(cb => !array.includes(cb));
                          
                              //Set Insert Control Checkboxes
                              insertControls.forEach(insert => setCheckbox(modifyGroupsWin, groupWindowLookup[insert].insertControl, "Enable"));
                              getDisabledCheckbox(insertControls).forEach(insert => setCheckbox(modifyGroupsWin, groupWindowLookup[insert].insertControl, "Disable"));
                          
                              //Set insert Bypass Checkboxes
                              insertBypasses.forEach(insert => setCheckbox(modifyGroupsWin, groupWindowLookup[insert].insertBypass, "Enable"));
                              getDisabledCheckbox(insertBypasses).forEach(insert => setCheckbox(modifyGroupsWin, groupWindowLookup[insert].insertBypass, "Disable"));
                          
                              //Set Send Level Checkboxes
                              sendLevels.forEach(insert => setCheckbox(modifyGroupsWin, groupWindowLookup[insert].sendLevel, "Enable"));
                              getDisabledCheckbox(sendLevels).forEach(insert => setCheckbox(modifyGroupsWin, groupWindowLookup[insert].sendLevel, "Disable"));
                          
                              //Set Send Mute Checkboxes
                              sendMutes.forEach(insert => setCheckbox(modifyGroupsWin, groupWindowLookup[insert].sendMute, "Enable"));
                              getDisabledCheckbox(sendMutes).forEach(insert => setCheckbox(modifyGroupsWin, groupWindowLookup[insert].sendMute, "Disable"));
                          
                              //Set Send Pan Checkboxes
                              sendPans.forEach(insert => setCheckbox(modifyGroupsWin, groupWindowLookup[insert].sendPan, "Enable"));
                              getDisabledCheckbox(sendPans).forEach(insert => setCheckbox(modifyGroupsWin, groupWindowLookup[insert].sendPan, "Disable"));
                          
                              //Set Send LFE Checkboxes
                              sendLFEs.forEach(insert => setCheckbox(modifyGroupsWin, groupWindowLookup[insert].sendLFE, "Enable"));
                              getDisabledCheckbox(sendLFEs).forEach(insert => setCheckbox(modifyGroupsWin, groupWindowLookup[insert].sendLFE, "Disable"));
                          }
                          
                          setGroupGlobals();
                          

                          But oddly enough, whenever I try and run the script I get the error message "MouseClickAction requires valid UIElement" on Line 40 which is this one:

                                      window.checkBoxes.whoseTitle.is("CheckBox").allItems[index].mouseClickElement();
                          

                          I've been trying quite a few things but none of them seem to work, no rush but do you know what might be causing this error? :s

                          1. Kitch Membery @Kitch2021-10-31 10:12:01.152Z

                            Hi @Eric_Huergo,

                            Ooops, there were a few mistakes on the last version and some things I did not account for (I was rushing).

                            This new script will open the "Modify Groups" window if it's not open and close once the checkboxes have been set.

                            It also sets the "Main" and Mix Attribute" Checkboxes

                            Here is the script;

                            let {
                                mainVolume, mainMute, mainPan, mainLFE,
                                insertControls, insertBypasses, sendLevels, sendMutes, sendPans, sendLFEs,
                                recordEnable, inputMonitoring, objectControls, solos, automationMode,
                            } = event.props;
                            
                            insertControls = insertControls || [];
                            insertBypasses = insertBypasses || [];
                            sendLevels = sendLevels || [];
                            sendMutes = sendMutes || [];
                            sendPans = sendPans || [];
                            sendLFEs = sendLFEs || [];
                            
                            const checkboxLookup = {
                                "main": { mainVolume: 20, mainMute: 21, mainPan: 22, mainLFE: 23, },
                                "a": { insertControl: 1, insertBypass: 0, sendLevel: 24, sendMute: 25, sendPan: 26, sendLFE: 27, },
                                "b": { insertControl: 3, insertBypass: 2, sendLevel: 28, sendMute: 29, sendPan: 30, sendLFE: 31, },
                                "c": { insertControl: 5, insertBypass: 4, sendLevel: 32, sendMute: 33, sendPan: 34, sendLFE: 35, },
                                "d": { insertControl: 7, insertBypass: 6, sendLevel: 36, sendMute: 37, sendPan: 38, sendLFE: 39, },
                                "e": { insertControl: 9, insertBypass: 8, sendLevel: 40, sendMute: 41, sendPan: 42, sendLFE: 43, },
                                "f": { insertControl: 11, insertBypass: 10, sendLevel: 44, sendMute: 45, sendPan: 46, sendLFE: 47, },
                                "g": { insertControl: 13, insertBypass: 12, sendLevel: 48, sendMute: 49, sendPan: 50, sendLFE: 51, },
                                "h": { insertControl: 15, insertBypass: 14, sendLevel: 52, sendMute: 53, sendPan: 54, sendLFE: 55, },
                                "i": { insertControl: 17, insertBypass: 16, sendLevel: 56, sendMute: 57, sendPan: 58, sendLFE: 59, },
                                "j": { insertControl: 19, insertBypass: 18, sendLevel: 60, sendMute: 61, sendPan: 62, sendLFE: 63, },
                                "mixAttributes": { recordEnable: 64, inputMonitoring: 67, objectControls: 68, solos: 65, automationMode: 66 },
                            };
                            
                            function openModifyGroupGlobals() {
                                sf.ui.proTools.appActivateMainWindow();
                            
                                sf.ui.proTools.groupsEnsureGroupListIsVisible();
                            
                                sf.ui.proTools.mainWindow.buttons.whoseTitle.is("Group List pop-up").first.popupMenuSelect({
                                    menuPath: ["Modify Groups"],
                                });
                            
                                const win = sf.ui.proTools.windows.whoseTitle.is("Modify Groups").first;
                                win.elementWaitFor();
                            
                                win.radioButtons.whoseTitle.is("Globals 3 of 3").first.elementClick();
                            }
                            
                            /**
                             * @param {Number} index
                             */
                            function setCheckbox(index, targetValue) {
                                const win = sf.ui.proTools.windows.whoseTitle.is("Modify Groups").first;
                            
                                switch (true) {
                                    case targetValue === "Enable" && !win.checkBoxes[index].isCheckBoxChecked:
                                        win.checkBoxes[index].elementClick();
                                        break
                                    case targetValue === "Disable" && win.checkBoxes[index].isCheckBoxChecked:
                                        win.checkBoxes[index].elementClick();
                                        break
                                }
                            }
                            
                            function setGroupGlobals() {
                                sf.ui.proTools.appActivateMainWindow();
                            
                                const win = sf.ui.proTools.windows.whoseTitle.is("Modify Groups").first;
                            
                                if (!win.exists) {
                                    openModifyGroupGlobals();
                                }
                                win.invalidate();
                            
                                //Set Main Checkboxes
                                const mainCheckboxes = checkboxLookup["main"];
                                mainVolume ? setCheckbox(mainCheckboxes.mainVolume, "Enable") : setCheckbox(mainCheckboxes.mainVolume, "Disable");
                                mainMute ? setCheckbox(mainCheckboxes.mainMute, "Enable") : setCheckbox(mainCheckboxes.mainMute, "Disable");
                                mainPan ? setCheckbox(mainCheckboxes.mainPan, "Enable") : setCheckbox(mainCheckboxes.mainPan, "Disable");
                                mainLFE ? setCheckbox(mainCheckboxes.mainLFE, "Enable") : setCheckbox(mainCheckboxes.mainLFE, "Disable");
                            
                                let getDisabledCheckbox = (array) => "abcdefghij".split('').filter(cb => !array.includes(cb));
                            
                                //Set Insert Control Checkboxes
                                insertControls.forEach(insert => setCheckbox(checkboxLookup[insert].insertControl, "Enable"));
                                getDisabledCheckbox(insertControls).forEach(insert => setCheckbox(checkboxLookup[insert].insertControl, "Disable"));
                            
                                //Set insert Bypass Checkboxes
                                insertBypasses.forEach(insert => setCheckbox(checkboxLookup[insert].insertBypass, "Enable"));
                                getDisabledCheckbox(insertBypasses).forEach(insert => setCheckbox(checkboxLookup[insert].insertBypass, "Disable"));
                            
                                //Set Send Level Checkboxes
                                sendLevels.forEach(insert => setCheckbox(checkboxLookup[insert].sendLevel, "Enable"));
                                getDisabledCheckbox(sendLevels).forEach(insert => setCheckbox(checkboxLookup[insert].sendLevel, "Disable"));
                            
                                //Set Send Mute Checkboxes
                                sendMutes.forEach(insert => setCheckbox(checkboxLookup[insert].sendMute, "Enable"));
                                getDisabledCheckbox(sendMutes).forEach(insert => setCheckbox(checkboxLookup[insert].sendMute, "Disable"));
                            
                                //Set Send Pan Checkboxes
                                sendPans.forEach(insert => setCheckbox(checkboxLookup[insert].sendPan, "Enable"));
                                getDisabledCheckbox(sendPans).forEach(insert => setCheckbox(checkboxLookup[insert].sendPan, "Disable"));
                            
                                //Set Send LFE Checkboxes
                                sendLFEs.forEach(insert => setCheckbox(checkboxLookup[insert].sendLFE, "Enable"));
                                getDisabledCheckbox(sendLFEs).forEach(insert => setCheckbox(checkboxLookup[insert].sendLFE, "Disable"));
                            
                                //Set Mix Attributes
                                const mixCheckboxes = checkboxLookup["mixAttributes"];
                                recordEnable ? setCheckbox(mixCheckboxes.recordEnable, "Enable") : setCheckbox(mixCheckboxes.recordEnable, "Disable");
                                inputMonitoring ? setCheckbox(mixCheckboxes.inputMonitoring, "Enable") : setCheckbox(mixCheckboxes.inputMonitoring, "Disable");
                                solos ? setCheckbox(mixCheckboxes.solos, "Enable") : setCheckbox(mixCheckboxes.solos, "Disable");
                                objectControls ? setCheckbox(mixCheckboxes.objectControls, "Enable") : setCheckbox(mixCheckboxes.objectControls, "Disable");
                                automationMode ? setCheckbox(mixCheckboxes.automationMode, "Enable") : setCheckbox(mixCheckboxes.automationMode, "Disable");
                            
                                //Close Window
                                win.buttons.whoseTitle.is("OK").first.elementClick();
                            }
                            
                            setGroupGlobals();
                            

                            The preset for "All On" looks like this;

                            The preset for "All Off" looks like this;

                            In the "Template" tab have the boolean checkboxes set like this;

                            And the string array's properties like this (Important note: leave the "Default Value" blank for these).

                            Make sure that your property names match exactly.

                            mainVolume, mainMute, mainPan, mainLFE,
                            insertControls, insertBypasses, sendLevels, sendMutes, sendPans, sendLFEs,
                            recordEnable, inputMonitoring, objectControls, solos, automationMode,
                            

                            At some stage I'll refactor/improve the script and upload it to the store in one form or another.

                            I hope that helps :-)

                            Rock on!

                            1. pretty sweet.

                              1. There should be a way to refactor the set checkboxes routines but loving this

                                1. Kitch Membery @Kitch2021-10-31 18:02:09.019Z

                                  @Chris_Shaw ,

                                  Yes there is for sure. May take another pass at it soon. :-)

                                  1. Eric Huergo @Eric_Huergo
                                      2021-11-01 00:52:28.844Z

                                      Holy s*** @Kitch, dare I say it the combo of how far and how fast you made/took to make this is "spooky". Just now getting back to it but damn!!! Mad respect - I'm super excited to test this out! Will definitely post anything I find but once again, thank you so much dude!

                                      1. Kitch Membery @Kitch2021-11-01 00:56:34.259Z

                                        My pleasure @Eric_Huergo, and thanks for the kind words. Tis my pleasure. This one should be a time saver! :-)

                                        1. DDan Powe @Dan_Powe6
                                            2024-11-15 20:04:13.542Z

                                            Hey @Kitch,

                                            This is awesome! So sorry to add to this so much later on, but is there a way to also include group type and a follow globals switch, as well as the ability to name the group?

                                            Many thanks in advance,
                                            Dan

                                            1. Kitch Membery @Kitch2024-11-15 20:13:06.349Z

                                              Hi @Dan_Powe6,

                                              Can you take some screenshots of the elements that you want to set?

                                              Thanks in advance.

                                              1. DDan Powe @Dan_Powe6
                                                  2024-11-15 22:08:54.182Z

                                                  Hey @Kitch,

                                                  Sure, no problem!

                                                  Everything you've already got going on is fantastic. Ideally, I'd also like to be able to choose the group name, group type and set whether or not 'follow globals' is checked.

                                                  1. DDan Powe @Dan_Powe6
                                                      2024-11-21 08:25:38.407Z

                                                      Hey @Kitch,

                                                      If at all possible, it would also be awesome to choose which settings preset to recall here, rather than using another action to click the correct UI element.

                                                      I appreciate I'm asking a lot so thanks so much in advance for even giving me the time of day, it's incredibly greatly appreciated.

                                                      1. Kitch Membery @Kitch2024-11-21 18:12:16.210Z

                                                        Hi @Dan_Powe6,

                                                        I'll take a look at this when I get a chance. :-)

                                                        Feel free to bump this thread next week if I have not gotten back to you by then.

                                                        1. DDan Powe @Dan_Powe6
                                                            2024-11-21 18:23:09.971Z

                                                            @Kitch You sir, are absolutely fantastic.

                                                            Thanks so much for taking a look!

                                                            1. DDan Powe @Dan_Powe6
                                                                2024-12-01 19:08:16.260Z

                                                                Hey @Kitch,

                                                                So sorry to pester you! Just wondering if you’ve had a chance to take a look at this?

                                                                Thanks so much!

                                                                1. Kitch Membery @Kitch2024-12-02 21:44:12.295Z

                                                                  Hi @Dan_Powe6,

                                                                  Sorry, Last week got away from me... The intention was there to get this sorted though.

                                                                  After reviewing the workflow you are after, what are the checkboxes, radio buttons, and text fields you'd like to be able to set, along with a preset being recalled?

                                                                  I assume...

                                                                  • "Name:" text field.
                                                                  • "Type:" radio button option.
                                                                  • "Follow Globals:" checkbox
                                                                  • "Include Rulers:" checkbox
                                                                  • Clicking the preset number 1-6 of your choice in the "Globals" tab.

                                                                  Is that correct?

                                                                  1. DDan Powe @Dan_Powe6
                                                                      2024-12-02 22:09:16.039Z

                                                                      Hi @Kitch

                                                                      That’s absolutely not a problem at all, I know the feeling!

                                                                      Yep, you’re absolutely right.

                                                                      1. Kitch Membery @Kitch2024-12-03 08:09:52.595Z

                                                                        Hi @Dan_Powe6, Rather untested, but here it is...

                                                                        You'll need to create a new script, turn it into a Command Template, create template properties as specified in the code, then customize your presets.

                                                                        const {
                                                                            groupName, // Property type "String.
                                                                            groupType, // Property type "User-Defined Enum" with ("Edit","Mix","Mix/Edit") options.
                                                                            presetNumber, // Property type "Short"
                                                                            followGlobals, // Property type "User-Defined Enum" with ("Enable","Disable") options.
                                                                            includeRulers, // Property type "User-Defined Enum" with ("Enable","Disable") options.
                                                                        } = event.props;
                                                                        
                                                                        const modifyGroupsWindow = sf.ui.proTools.windows.whoseTitle.is("Modify Groups").first;
                                                                        
                                                                        function doWithModifyGroupsWindow(callback) {
                                                                            sf.ui.proTools.appActivateMainWindow();
                                                                        
                                                                            if (!modifyGroupsWindow.exists) {
                                                                                sf.ui.proTools.groupsEnsureGroupListIsVisible();
                                                                        
                                                                                sf.ui.proTools.mainWindow.buttons.whoseTitle.is("Group List pop-up").first.popupMenuSelect({
                                                                                    menuPath: ["Modify Groups"],
                                                                                });
                                                                        
                                                                                modifyGroupsWindow.elementWaitFor();
                                                                            }
                                                                        
                                                                            modifyGroupsWindow.radioButtons.whoseTitle.startsWith("Globals").first.elementClick();
                                                                        
                                                                            modifyGroupsWindow.invalidate();
                                                                        
                                                                            try {
                                                                                callback();
                                                                            } catch (err) {
                                                                                log(`There was an error modifying the groups dialog \n${err}`);
                                                                            } finally {
                                                                                // Click "OK"
                                                                                modifyGroupsWindow.buttons.whoseTitle.is("OK").first.elementClick();
                                                                                // Wait for window to dissapear.
                                                                                modifyGroupsWindow.elementWaitFor({ waitForNoElement: true });
                                                                            }
                                                                        }
                                                                        
                                                                        function main() {
                                                                            doWithModifyGroupsWindow(() => {
                                                                                sf.ui.proTools.appActivateMainWindow();
                                                                        
                                                                                modifyGroupsWindow.textFields.first.elementWaitFor();
                                                                        
                                                                                // Set the "Name" text field
                                                                                modifyGroupsWindow.textFields.first.elementSetTextFieldWithAreaValue({
                                                                                    value: groupName
                                                                                });
                                                                        
                                                                                // Set the group "Type" radio button
                                                                                modifyGroupsWindow.radioButtons.whoseTitle.is(groupType).first.elementClick();
                                                                        
                                                                                // Set the "Follow Globals:" checkbox
                                                                                const followGlobalsCheckbox = modifyGroupsWindow.checkBoxes.whoseTitle.is("Follow Globals").first;
                                                                                followGlobalsCheckbox.checkboxSet({ targetValue: followGlobals });
                                                                        
                                                                                // Set the "Include Rulers:" checkbox
                                                                                const includeRulersCheckbox = modifyGroupsWindow.checkBoxes.whoseTitle.is("Include Rulers").first;
                                                                                includeRulersCheckbox.checkboxSet({ targetValue: includeRulers });
                                                                        
                                                                                // Convert preset number (presetNumber) property value into a string
                                                                                const presetNumberAsString = presetNumber.toString();
                                                                        
                                                                                // Click the "Settings" preset number
                                                                                modifyGroupsWindow.buttons.whoseTitle.is(presetNumberAsString).first.elementClick();
                                                                            });
                                                                        }
                                                                        
                                                                        main();
                                                                        

                                                                        Let me know if you get stuck creating the Command Template. :-)

                                                                        1. DDan Powe @Dan_Powe6
                                                                            2024-12-04 19:36:29.068Z

                                                                            Hey @Kitch

                                                                            Thanks so much for this! I've got a template made and things are definitely working however, it appears to be recalling presets from the 'Globals' tab even when follow globals is turned off. If possible, when that's off, it'd be great to have it recall the preset from the 'Attributes' tab instead.

                                                                            Additionally, is there any way at all to have this open the 'Create Group' dialog rather than the 'Modify Group' dialog?

                                                                            Thanks so much!

                                                                            1. Kitch Membery @Kitch2024-12-04 20:01:57.172Z

                                                                              Hi @Dan_Powe6,

                                                                              Ahh... I started creating this from scratch to remove redundant code, and was modifying the group.

                                                                              So the changes I need to make are...

                                                                              • Make it work for the "Create Group" window.
                                                                              • If followGlobals is set to "Disable" Switch to the "Attributes" tab and select a preset.

                                                                              I'll take a swing at it this afternoon. :-)

                                                                              1. In reply toDan_Powe6:
                                                                                Kitch Membery @Kitch2024-12-04 20:38:06.822Z

                                                                                Hi @Dan_Powe6,

                                                                                Not thoroughly tested but this should do what you're after...

                                                                                const {
                                                                                    groupName, // Property type "String.
                                                                                    groupType, // Property type "User-Defined Enum" with ("Edit","Mix","Mix/Edit") options.
                                                                                    presetNumber, // Property type "Short"
                                                                                    followGlobals, // Property type "User-Defined Enum" with ("Enable","Disable") options.
                                                                                    includeRulers, // Property type "User-Defined Enum" with ("Enable","Disable") options.
                                                                                } = event.props;
                                                                                
                                                                                const createGroupsWindow = sf.ui.proTools.windows.whoseTitle.is("Create Group").first;
                                                                                
                                                                                function checkIfGroupExists() {
                                                                                    const groupListView = sf.ui.proTools.mainWindow.groupListView;
                                                                                    const rows = groupListView.children.whoseRole.is("AXRow");
                                                                                    const groupNames = rows.filter(row => row.children.whoseRole.is("AXCell").allItems[1].buttons.first.title.value.split(" - ").pop() === groupName);
                                                                                
                                                                                    const groupExists = groupNames.length >= 1;
                                                                                
                                                                                    return groupExists;
                                                                                }
                                                                                
                                                                                function doWithCreateGroupWindow(callback) {
                                                                                    sf.ui.proTools.appActivateMainWindow();
                                                                                
                                                                                    const groupExists = checkIfGroupExists();
                                                                                
                                                                                    // Bail out if Group name exists
                                                                                    if (groupExists) {
                                                                                        log("Create Group",`The group named "${groupName}" already exists.`);
                                                                                        throw 0;
                                                                                    }
                                                                                
                                                                                    if (!createGroupsWindow.exists) {
                                                                                        sf.ui.proTools.groupsEnsureGroupListIsVisible();
                                                                                
                                                                                        // Invalidate Pro Tools main window if the "Groups List" was not visible.
                                                                                        sf.ui.proTools.mainWindow.invalidate();
                                                                                
                                                                                        sf.ui.proTools.mainWindow.buttons.whoseTitle.is("Group List pop-up").first.popupMenuSelect({
                                                                                            menuPath: ["New Group..."],
                                                                                        });
                                                                                
                                                                                        createGroupsWindow.elementWaitFor();
                                                                                    }
                                                                                
                                                                                    if (followGlobals === "Enable") {
                                                                                        createGroupsWindow.radioButtons.whoseTitle.startsWith("Globals").first.elementClick();
                                                                                    } else {
                                                                                        createGroupsWindow.radioButtons.whoseTitle.startsWith("Attributes").first.elementClick();
                                                                                    }
                                                                                
                                                                                    createGroupsWindow.invalidate();
                                                                                
                                                                                    try {
                                                                                        callback();
                                                                                    } catch (err) {
                                                                                        log(`There was an error modifying the groups dialog \n${err}`);
                                                                                    } finally {
                                                                                        // Click "OK"
                                                                                        createGroupsWindow.buttons.whoseTitle.is("OK").first.elementClick();
                                                                                        // Wait for window to dissapear.
                                                                                        createGroupsWindow.elementWaitFor({ waitForNoElement: true });
                                                                                    }
                                                                                }
                                                                                
                                                                                function main() {
                                                                                    doWithCreateGroupWindow(() => {
                                                                                        sf.ui.proTools.appActivateMainWindow();
                                                                                
                                                                                        createGroupsWindow.textFields.first.elementWaitFor();
                                                                                
                                                                                        // Set the "Name" text field
                                                                                        createGroupsWindow.textFields.first.elementSetTextFieldWithAreaValue({
                                                                                            value: groupName
                                                                                        });
                                                                                
                                                                                        // Set the group "Type" radio button
                                                                                        createGroupsWindow.radioButtons.whoseTitle.is(groupType).first.elementClick();
                                                                                
                                                                                        // Set the "Follow Globals:" checkbox
                                                                                        const followGlobalsCheckbox = createGroupsWindow.checkBoxes.whoseTitle.is("Follow Globals").first;
                                                                                        followGlobalsCheckbox.checkboxSet({ targetValue: followGlobals });
                                                                                
                                                                                        // Set the "Include Rulers:" checkbox
                                                                                        const includeRulersCheckbox = createGroupsWindow.checkBoxes.whoseTitle.is("Include Rulers").first;
                                                                                        includeRulersCheckbox.checkboxSet({ targetValue: includeRulers });
                                                                                
                                                                                        // Convert preset number (presetNumber) property value into a string
                                                                                        const presetNumberAsString = presetNumber.toString();
                                                                                
                                                                                        // Click the "Settings" preset number
                                                                                        createGroupsWindow.buttons.whoseTitle.is(presetNumberAsString).first.elementClick();
                                                                                    });
                                                                                }
                                                                                
                                                                                main();
                                                                                

                                                                                Let me know how it goes for you.

                                                                                1. DDan Powe @Dan_Powe6
                                                                                    2024-12-06 13:34:11.978Z

                                                                                    @Kitch This is perfect!

                                                                                    Thank you so much for your time and effort, I really do appreciate it! 😊