No internet connection
  1. Home
  2. How to

Toggle A/B Switch in ADPTR MetricAB

By Peter Mansson @Peter_Mansson
    2022-02-02 12:24:45.077Z

    Hi!

    I have made a macro that: ”OPEN INSERT 10 ON MONITOR TRACK (ADPTR)”

    This is for my Monitor Master and I have ADPTR Metric A/B on Slot #10 which opens on that macro.

    Is there an easy way to now toggle the A/B switch on the already open plugin (ADPTR) in a new macro that I can have on new button on my Stream Deck?

    Thanks,
    Peter

    • 7 replies
    1. Anthony Bauman @Anthony_Bauman
        2022-02-02 14:23:37.047Z

        Hi, this is the only way I would know how to make that work.
        Basically it's a macro command called "Mouse Click Relative to UI Element"
        Then I measuered from the plugin window's close button to the A/B button.
        That's how you can replicate it with a macro. Or you can copy and paste this script.

        sf.ui.proTools.windows.whoseTitle.is("Plug-in: ADPTR StreamLiner").first.getElement("AXCloseButton").mouseClickElement({
        relativePosition: {"x":520,"y":180},
        });

        1. PPeter Mansson @Peter_Mansson
            2022-02-02 14:55:41.655Z

            Great, thanks!

            Did this for ADPTR MetricAB, works fine:

            sf.ui.proTools.windows.whoseTitle.is("Plug-in: ADPTR MetricAB").first.getElement("AXCloseButton").mouseClickElement({relativePosition: {"x":138,"y":570},});

            1. Anthony Bauman @Anthony_Bauman
                2022-02-02 14:58:41.966Z

                Great, your welcome.

            2. In reply toPeter_Mansson:
              Ben Rubin @Ben_Rubin
                2022-02-03 03:08:12.640Z

                @Dreamcatcher_Studio also has a macro in the store that does this and works well for me.

                1. In reply toPeter_Mansson:
                  Nathan Salefski @nathansalefski
                    2023-08-05 03:33:33.981Z

                    @Kitch or anyone really, why isn't this working? It can easily switch from B to A (the 'AXDecrement') but can't seem to go from A to B (the 'AXIncrement'). Is it somehow the initValue is not 0?

                    var pluginWin = sf.ui.proTools.windows.whoseTitle.is("Plug-in: ADPTR MetricAB").first
                    var pluginView = pluginWin.groups.whoseTitle.is("FXTDMEditView").first
                    if (!pluginView.exists) throw "Could Not Find MetricAB";
                    
                    //Use this to log a list of all parameter names:
                    //log(pluginView.children.map(c => c.title.value).join('\n'));
                    //throw 0;
                    
                    var parameterControl = pluginView.children.whoseTitle.is('AB Switch').first;
                    
                    //Toggle A/B
                    if (parameterControl.value.invalidate().intValue === 0) {
                        parameterControl.elementClick({
                            actionName: 'AXIncrement'
                        });
                    } else {
                        parameterControl.elementClick({
                            actionName: 'AXDecrement'
                        });
                    }
                    
                    1. Kitch Membery @Kitch2023-08-05 04:51:10.504Z

                      Hi @nathansalefski,

                      Unfortunately, I don't have this plugin on my current system.

                      If this is from a package downloaded from the store, it would be best to ask in the forum section for the package Forum for Dreamcatcher ADPTR Metric A/B Toggle Switch package

                      To get help with packages downloaded from the store please see the following link. bit.ly/sfscripthelp

                      1. Nathan Salefski @nathansalefski
                          2023-08-05 05:05:17.236Z

                          I saw a similar usage originally here Slider in Audiosuite window #post-2. I have my own script that opens and closes this plugin and uses mouse clicks relative to UI to toggle back and fourth but wanted to use as little mouse clicks as possible as you mentioned previously it’s the least robust way to interact.