No internet connection
  1. Home
  2. How to

Pro Tools 2022.4.0 Preset Toggle Buttons

By Mitch Willard @Mitch_Willard_the2nd
    2022-05-05 02:29:56.453Z

    Hi All,

    For anyone interested:

    I've noticed since updating to the latest version of Pr Tools (2022.4.0), for any scripts that uses the Preset Toogle functions eq "Bounce Mix" and the "Import Session Data", the script needs to change slightly to work as they have different names now.

    For Example,
    This code

    sf.ui.proTools.windows.whoseTitle.is("Bounce Mix").first.buttons.whoseTitle.is("Preset Toggle").first.elementClick();
    

    Needs to be changed to add a "1" for the "Preset Toggle", like so.

    sf.ui.proTools.windows.whoseTitle.is("Bounce Mix").first.buttons.whoseTitle.is("Preset Toggle 1").first.elementClick();
    
    

    Not sure if this is the best fix, maybe someone else knows better.
    I have had to double up some scripts as I use 2022.4.0 at home, and 2021 at work.

    Hope this helps.

    Cheers

    Mitch

    Solved in post #4, click to view
    • 4 replies
    1. Thanks for sharing!

    2. Andrew Scheps @Andrew_Scheps
        2022-05-06 13:03:44.888Z

        The best way I've found to deal with this is just use:

        let presetButtons = sf.ui.proTools.windows.whoseTitle.is("Bounce Mix").first.buttons.allItems.filter(b => b.title.value.includes("Preset"));
        

        This will give you an array, in order, of the 5 preset buttons. Obviously if they change the order at any point this could be an issue, but this way you don't need separate code and Pro Tools version checking.

        And if you only need one button you can short-circuit the code to pick it out of the array in the same line.

        I've tested this on PTs 21.12 and 22.4 and it seems to work fine.

        Reply3 LikesSolution
        1. Mitch Willard @Mitch_Willard
            2022-05-06 14:00:49.227Z

            Awesome! Thanks @Andrew_Scheps