No internet connection
  1. Home
  2. How to

Toggle Active/Inactive Group by name

By alex alcanjim @alex_alcanjim
    2021-08-09 07:30:07.395Z

    Hi all!

    I'm just loooking for a script that allows me to active/inactive certain group on Pro Tools.

    Let say that I work with groups like GroupA, GroupB, etc... I would love to have a shortcut to toggle active/inactive state for each group.

    Is there any way to do that?

    Thanks so much in advance for your help!

    Solved in post #4, click to view
    • 4 replies
    1. samuel henriques @samuel_henriques
        2021-08-09 08:05:35.101Z

        Hello Alex,

        This should do it,
        Checking if the group is active or not #post-7

        1. Aalex alcanjim @alex_alcanjim
            2021-08-09 09:50:55.996Z

            Hi Samuel,

            Thanks so much for your help! I've tried the script and works fine but there is an issue that we should conside.

            If the Group is assigned to a VCA, its name will appear as "Group_Name (VCA_Name)", and if you doesn't include on the script the full name (including VCA name), the script doesn't work at all.

            Could we modify the script and try to make it active/inactive groups which "CONTAINS" the name of the Group we want to active/inactive?

            Thanks so much for your help!

            1. samuel henriques @samuel_henriques
                2021-08-09 10:29:40.105Z

                Hey Alex,

                This should toggle the first containing "Group Name",

                sf.ui.proTools.groupsEnsureGroupListIsVisible();
                function toggleGroupActive(groupName) {
                    sf.ui.proTools.mainWindow.groupListView.childrenByRole('AXRow').map(r => ({
                        groupName: r.childrenByRole('AXCell').allItems[1].buttons.first.title.value.split(/-\s/)[1],
                        btn: r.childrenByRole('AXCell').allItems[1].buttons.first,
                        row: r,
                    })).filter(g => g.groupName.includes(groupName))[0].btn.elementClick();
                }
                
                toggleGroupActive("Group Name");
                
                ReplySolution
                1. Aalex alcanjim @alex_alcanjim
                    2021-08-09 13:11:56.309Z

                    HI @samuel_henriques !

                    It works perfectly! Thanks so much for your help!

                    Cheers,