No internet connection
  1. Home
  2. How to

(batch) rename clips using memory location, track name & track comment

By Rob Sannen @Rob_Sannen
    2022-12-29 15:28:21.344Z

    Hi,
    For an archiving project, I need to chop up digitized multitrack-tapes (24 track analog for example) per song, and rename the files so they make sense in every workstation.

    Here's how the session looks like now:

    For each song on the multitrack, I added a marker where the song starts, and I've already consolidated these clips.

    I need the filename to end up like this: memorylocation-trackname-trackcomment

    I'm investigating down the path of storing the 3 required names as variables, but lack programming skills.

    Thanks

    Rob

    • 3 replies
    1. K
      Kurt Kellenberger @Kurt_Kellenberger
        2023-08-11 15:45:11.109Z

        Hi, did you ever figure out a solution for this task? I need to do something very similar, batch rename clips as memorylocation-trackname-trackcomment. Thanks!

        1. In reply toRob_Sannen:
          Nathan Salefski @nathansalefski
            2023-08-11 20:10:35.415Z2023-08-11 20:16:50.250Z

            @Kurt_Kellenberger cc-ing you here as well. It will prompt you to select the memory location each time, otherwise I have no way to know which memory location you'd like. This should work though! It's just one clip at a time.

            sf.ui.proTools.invalidate()
            
            function prompt(item) {
            
                let prompt = sf.interaction.popupSearch({ items: item.map(x => ({ name: x["Name"] }))}).item.name
                
               return prompt
            };
            
            let fetchMemLoc = sf.proTools.memoryLocationsFetch().collection['List']
            
            let memoryLocations = prompt(fetchMemLoc)
            
            let trackName = sf.ui.proTools.selectedTrack.titleButton.value.invalidate().value
            
            let comment = sf.ui.proTools.selectedTrack.textFields.first.value.invalidate().value
            
            let name = `${memoryLocations} - ${trackName} - ${comment}`
            
            function renameClip() {
            
                sf.ui.proTools.appActivate();
                sf.ui.proTools.mainWindow.invalidate();
              
                //Open Clip Name Window
                sf.ui.proTools.menuClick({ menuPath: ["Clip", "Rename..."] });
            
                //Define Clip Name Window
                const clipNameWin = sf.ui.proTools.windows.whoseTitle.is("Name").first;
            
                //Wait for Clip Name Window to Appear
                clipNameWin.elementWaitFor({waitType: "Appear"});
            
                //Define Clip Text Field
                const clipTextField = clipNameWin.groups.whoseTitle.is("Name").first.textFields.first
                
                //Rename Clip
                clipTextField.elementSetTextFieldWithAreaValue({ value: `${name}`,});
            
                //Close clip name window
                clipNameWin.buttons.whoseTitle.is("OK").first.elementClick();
            
                //Wait for Clip Name Window to Disappear
                clipNameWin.elementWaitFor({waitType: "Disappear"});
            
            }
            
            renameClip();
            
            1. RRob Sannen @Rob_Sannen
                2023-08-21 18:04:33.834Z

                Hi both, sorry for the late reply.
                Yes I was able to put something together. If you search for my name in the store, you'll be able to give the macro's a try.