No internet connection
  1. Home
  2. How to

Find All of this clip

By Audio Remote @Audio_Remote
    2021-06-10 17:50:35.161Z2021-06-14 17:01:14.914Z

    Hi- I am interested in selectig every instance of a particular peiece of media (a camera reel or source name). This helps with sorting diologue by character to different tracks. So the long way around (without soundflow)
    Assuming one instance of the clip is selected.
    1- Clip Menu- Rename
    2- Select the clip name and ommit the last several characters (usually after the "." These are put in by pro tools and It seems to make the search results incomplete.

    3-Copy Text
    4-Right click the clips menu triangke at the top and "Find clip" or "Shift Command F"
    5- Select the first clip in the result list in clips window, then Shift select the last to get all.
    6-Right click any of the thos clips in the list and select "Object Select in Edit Window"

    All of the clips of that source are now selected. I can cut and past to other tracks or switch the grabber tool to "Object" and CTRL Drag them to the desired tracks.

    I am hung up with getting rid of the characters at the end of the clip name. I will paste what I have so far. Any advice is much appreciated.

    sf.app.launch({
        path: "/Applications/Pro Tools.app",
    });
    
    sf.ui.proTools.menuClick({
        menuPath: ["Clip","Rename..."],
    });
    
    sf.keyboard.press({
        keys: "right, left, left, left, left, left, left, left, left, left, left, left, left, left, left, left, left, left, shift+home, cmd+c, escape",
    });
    
    /* sf.keyboard.press({
        keys: "cmd+c, escape",
    }); */
    
    sf.ui.proTools.menuClick({
        menuPath: ["View","Other Displays","Clip List"],
        targetValue: "Enable",
        forceClick: true,
    });
    
    sf.keyboard.press({
        keys: "cmd+shift+f",
    });
    
    sf.keyboard.press({
        keys: "cmd+v, return, cmd+a",
    });
    
    
    • 1 replies
    1. samuel henriques @samuel_henriques
        2021-06-12 17:18:58.919Z

        hello @Audio_Remote,

        I have two scripts for this:

        Select any clip, and and run the script. It will object select all with same name up to the last "." or "-"(if "." doesn't exist).

        
        
        function getRegionName() {
        
            sf.ui.proTools.menuClick({ menuPath: ['Clip', 'Rename...'] });
            sf.ui.proTools.windows.whoseTitle.is('Name').first.elementWaitFor();
            var currentRegionName = sf.ui.proTools.windows.whoseTitle.is('Name').first.groups.whoseTitle.is('Name').first.textFields.first.value.value;
            sf.ui.proTools.windows.whoseTitle.is('Name').first.buttons.whoseTitle.is('Cancel').first.elementClick();
            return currentRegionName
        }
        
        function putRegionName(regionName) {
        
            sf.ui.proTools.appActivateMainWindow();
            sf.keyboard.press({
                keys: "cmd+shift+f",
            });
            sf.ui.proTools.windows.whoseTitle.is('Find Clips').first.elementWaitFor();
            sf.ui.proTools.windows.whoseTitle.is('Find Clips').first.checkBoxes.whoseTitle.is('By name').first.checkboxSet({
                targetValue: "Enable",
            });
            sf.ui.proTools.windows.whoseTitle.is('Find Clips').first.textFields.whoseTitle.is('').first.elementSetTextFieldWithAreaValue({ value: regionName, });
            sf.ui.proTools.windows.whoseTitle.is('Find Clips').first.buttons.whoseTitle.is('OK').first.elementClick();
        
        }
        
        
        function selectClipsInClipList() {
            sf.ui.proTools.mainWindow.popupButtons.whoseTitle.is('Clip List').first.popupMenuSelect({
                menuPath: ["Select", "All"],
                targetValue: "Enable",
            });
        
            const row = sf.ui.proTools.mainWindow.clipListView.childrenByRole("AXRow").first;
        
        
            row.children.allItems[1].children.first.popupMenuSelect({
                isRightClick: true,
                menuPath: ['Object Select in Edit Window'],
                onError: "Continue",
            });
        }
        
        
        sf.ui.proTools.appActivateMainWindow();
        
        sf.ui.proTools.menuClick({
            menuPath: ["View", "Other Displays", "Clip List"],
            targetValue: "Enable",
        });
        
        sf.ui.proTools.mainWindow.popupButtons.whoseTitle.is('Clip List').first.popupMenuSelect({
            menuPath: ["Show", "Auto-Created"],
            targetValue: "Enable",
        });
        
        sf.keyboard.press({
            keys: "cmd+shift+d",
        });
         
        
        let currentName = getRegionName()
        
        if (currentName.indexOf(".") !== -1) {
            currentName = currentName.slice(0, currentName.indexOf("."))
        }
        if (currentName.lastIndexOf("-") !== -1) {
            currentName = currentName.slice(0, currentName.lastIndexOf("-"))
        }
        
        putRegionName(currentName)
        
        selectClipsInClipList()
        

        and this one will open the find window, so you can type the name you want. Once you click "Ok" it will object select all found.

        
        
        function manualPutRegionName() {
        
            sf.ui.proTools.appActivateMainWindow();
            sf.keyboard.press({
                keys: "cmd+shift+f",
            });
            sf.ui.proTools.windows.whoseTitle.is('Find Clips').first.elementWaitFor();
            sf.ui.proTools.windows.whoseTitle.is('Find Clips').first.checkBoxes.whoseTitle.is('By name').first.checkboxSet({
                targetValue: "Enable",
            });
        }
        
        function selectClipsInClipList() {
            sf.ui.proTools.mainWindow.popupButtons.whoseTitle.is('Clip List').first.popupMenuSelect({
                menuPath: ["Select", "All"],
                targetValue: "Enable",
            });
        
        
        
            const row = sf.ui.proTools.mainWindow.clipListView.childrenByRole("AXRow").first;
        
        
            row.children.allItems[1].children.first.popupMenuSelect({
                isRightClick: true,
                menuPath: ['Object Select in Edit Window'],
                onError: "Continue",
            });
        }
        
        
        sf.ui.proTools.appActivateMainWindow();
        
        sf.ui.proTools.menuClick({
            menuPath: ["View", "Other Displays", "Clip List"],
            targetValue: "Enable",
        });
        
        sf.ui.proTools.mainWindow.popupButtons.whoseTitle.is('Clip List').first.popupMenuSelect({
            menuPath: ["Show", "Auto-Created"],
            targetValue: "Enable",
        });
        
        sf.keyboard.press({
            keys: "cmd+shift+d",
        });
        
        
        manualPutRegionName()
        ////////////////////////////////////////////////////////////////////
        
        
        sf.ui.proTools.windows.whoseTitle.is('Find Clips').first.elementWaitFor({ waitType: 'Disappear', timeout: -1 });
        
        //We have a search active
        if (sf.ui.proTools.mainWindow.children.whoseRole.is("AXStaticText").allItems[2].value.invalidate().value.indexOf('[') >= 0) {
            selectClipsInClipList()
        
        } else {
        
            sf.keyboard.press({
                keys: "cmd+shift+d",
            });
        }
        

        I made these a long time ago so they might need some revision. But haven't been failing

        Hope it helps, let me know.