No internet connection
  1. Home
  2. Macro and Script Help

Rename clips from track name in Pro Tools Stream Deck Button

By Andrew Wickett @Andrew_Wickett
    2023-03-02 15:35:28.034Z

    Title

    Rename clips from track name in Pro Tools Stream Deck Button

    What do you expect to happen when you run the script/macro?

    I copied a script from the web to copy the track names to clips in Pro Tools but it doesn't work. Can you help please?

    Are you seeing an error?

    Error in top left of screen 02.03.2023 15:33:10.09 [Backend]: !! Command Error: Rename Clips From Track Name [user:default:cler9gitf0001zi10me58ypn4]: @Error running command package:cler947120000zi10ab97cwjz (Rename Clips From Track Name: Line 1) Element was not found or removed after waiting 2000 ms (Track2ClipName: Line 12)

    << Command: Rename Clips From Track Name [user:default:cler9gitf0001zi10me58ypn4]

    02.03.2023 15:33:24.87 [Backend]: [SF_FIREBASE_WS]: Sending keep-alive

    What happens when you run this script?

    Nothing. Just the error pop up

    How were you running this script?

    I used a Stream Deck button

    How important is this issue to you?

    5

    Details

    {
        "inputExpected": "I copied a script from the web to copy the track names to clips in Pro Tools  but it doesn't work. Can you help please?",
        "inputIsError": true,
        "inputError": "Error in top left of screen\n02.03.2023 15:33:10.09  [Backend]: !! Command Error: Rename Clips From Track Name [user:default:cler9gitf0001zi10me58ypn4]:\n@Error running command package:cler947120000zi10ab97cwjz (Rename Clips From Track Name: Line 1)\n    Element was not found or removed after waiting 2000 ms (Track2ClipName: Line 12)\n\n<< Command: Rename Clips From Track Name [user:default:cler9gitf0001zi10me58ypn4]\n\n02.03.2023 15:33:24.87  [Backend]: [SF_FIREBASE_WS]: Sending keep-alive\n",
        "inputWhatHappens": "Nothing. Just the error pop up",
        "inputHowRun": {
            "key": "-MpfwmPg-2Sb-HxHQAff",
            "title": "I used a Stream Deck button"
        },
        "inputImportance": 5,
        "inputTitle": "Rename clips from track name in Pro Tools Stream Deck Button"
    }

    Source

    //Macro converted to script
    
    
    //Calling command "Track2ClipName" from package "Default Package"
    sf.soundflow.runCommand({
        commandId: 'package:cler947120000zi10ab97cwjz',
        props: {}
    });
    
    
    

    Links

    User UID: UxpDF9SlTkQISz2qzijLdDL3PqB3

    Feedback Key: sffeedback:UxpDF9SlTkQISz2qzijLdDL3PqB3:-NPXxg_u_cT0ZgGklgQm

    Feedback ZIP

    • 3 replies
    1. Mitch Willard @Mitch_Willard
        2023-03-03 01:22:21.417Z

        Hi @Andrew_Wickett

        Are you wanting to name only one clip on a track? or multiple clips on one track?
        Did you want to name the clip only or name the clip and disk file? If you name the "clip and disk file", you can only really name one clip this, so depending on what you want to achieve which determine how the code will work.

        thanks

        Mitch

        1. In reply toAndrew_Wickett:
          Mitch Willard @Mitch_Willard
            2023-03-03 01:44:00.334Z

            @Andrew_Wickett

            Here you go.

            delete either nameClipSameAsTrack("name clip only"); or nameClipSameAsTrack("name clip and disk file"); in which you don't want to use in the code.

            function nameClipSameAsTrack(clipNameType) {
            
                sf.ui.proTools.appActivate;
                sf.ui.proTools.appActivateMainWindow;
            
                const nameClipWindow = sf.ui.proTools.windows.whoseTitle.is("Name").first;
            
                var nameTrack = sf.ui.proTools.selectedTrack.normalizedTrackName;
            
                if (sf.ui.proTools.getMenuItem(`Clip`, `Rename...`).isEnabled) {
                    sf.ui.proTools.getMenuItem(`Clip`, `Rename...`).elementClick();
            
                    nameClipWindow.elementWaitFor({
                        waitType: 'Appear',
                        timeout: 1000,
                        pollingInterval: 50,
            
                    });
            
                    nameClipWindow.groups.whoseTitle.is("Name").first.textFields.first.elementSetTextFieldWithAreaValue({
                        value: nameTrack,
                    });
            
                    nameClipWindow.groups.whoseTitle.is("Name").first.radioButtons.whoseTitle.is(clipNameType).first.checkboxSet({
                        targetValue: 'Enable',
                    });
            
                    nameClipWindow.buttons.whoseTitle.is("OK").first.elementClick();
                } else {
                    log(`No Clip Selected`)
                };
            
            
            };
            
            ///***DELETE ONE OF THESE DEPENDING ON WHAT YOUR DESIRED OUTCOME IS***///
            //USE THIS FOR NAME CLIP ONLY, THIS WILL ALLOW YOU TO DO MULTIPLE CLIPS ON ONE TRACK
            nameClipSameAsTrack("name clip only");
            
            //THIS WILL NAME THE CLIP IN THE SESSION AND THE DISK FILE IN THE AUDIO FILES FOLDER
            nameClipSameAsTrack("name clip and disk file");
            
            
            
            

            cheers

            Mitch

            1. D
              In reply toAndrew_Wickett:
              Dylan Furrow @Dylan_Furrow
                2024-09-03 15:47:06.132Z

                Hey guys, I've been trying to use this script and it doesn't seem to be renaming the clips. Everything else seems fine though