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

Efficiently scroll a specific track.

By Michael Feldman @Michael_Feldman
    2023-07-12 02:07:21.977Z

    Title

    Efficiently scroll a specific track.

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

    Select/scroll to the track "MOBILE UNIT" and orient it as the uppermost track visible in the edit window.

    I'd like to use it to instantly jump to this track wherever it is in the session, without doing anything else.

    Are you seeing an error?

    What happens when you run this script?

    This script seems to do few extra steps that bog it down. It appears to first go to the desired track, navigate one track up, then back down, then it reselcts the previously selected tracks.

    I'd love for it to behave the same as if you click a track in the track list in the Avid Control app, and Pro Tools efficiently jumps to that track.

    How were you running this script?

    I used a keyboard shortcut within the target app

    How important is this issue to you?

    4

    Details

    {
        "inputExpected": "Select/scroll to the track \"MOBILE UNIT\" and orient it as the uppermost track visible in the edit window. \n\nI'd like to use it to instantly jump to this track wherever it is in the session, without doing anything else.  ",
        "inputIsError": false,
        "inputWhatHappens": "This script seems to do few extra steps that bog it down.  It appears to first go to the desired track, navigate one track up, then back down, then it reselcts the previously selected tracks.  \n\nI'd love for it to behave the same as if you click a track in the track list in the Avid Control app, and Pro Tools efficiently jumps to that track.  ",
        "inputHowRun": {
            "key": "-Mpfwh4RkPLb2LPwjePT",
            "title": "I used a keyboard shortcut within the target app"
        },
        "inputImportance": 4,
        "inputTitle": "Efficiently scroll a specific track."
    }

    Source

    sf.ui.proTools.trackGetByName({ name: "MOBILE UNIT", makeVisible: true }).track.trackScrollToView();
    
    sf.ui.proTools.mainWindow.groups.whoseTitle.is("MOBILE UNIT - Basic Folder Track ").first.popupButtons.first.mouseClickElement({
       isControl: true,
       isShift: true,
    });
     
    

    Links

    User UID: pROqkdj7RKStj1Qc1BqhB3YPBJx1

    Feedback Key: sffeedback:pROqkdj7RKStj1Qc1BqhB3YPBJx1:-N_6qa9V1oAfUT8P6JYV

    Feedback ZIP

    • 2 replies
    1. Mitch Willard @Mitch_Willard
        2023-07-12 04:27:09.972Z

        Hi @Michael_Feldman

        I use the script below that I find more efficient for scrolling to a track that uses the function from the pro tools menu. super quick.

        ///SCROLL TO TRACK FUNCTION///
            function scrollToTrack(trackName) {
        
                let confirmationDlg = sf.ui.proTools.confirmationDialog;
        
                sf.ui.proTools.menuClick({
                    menuPath: ["Track", "Scroll to Track..."]
                });
        
                confirmationDlg.elementWaitFor({
                    waitType: "Appear",
                    pollingInterval: 200
                });
        
                confirmationDlg.textFields.first.elementSetTextFieldWithAreaValue({
                    value: trackName,
                });
        
                confirmationDlg.buttons.whoseTitle.is("OK").first.elementClick();
        
            };
        
        ///Add the track name in-between " " to scroll to that specific track
        scrollToTrack("Add Track Name Here")
        
        

        Cheers

        Mitch

        1. MMichael Feldman @Michael_Feldman
            2023-07-12 07:08:38.245Z

            YES @Mitch_Willard, thank you. Your script works WAY better!

            In a previous attempt at this, I was also messing with the "Scroll to Track..." menu function. I was just crudely pasting the track name after a predefined pause, and it would often get mistimed or mixed up with other keystrokes. This is much better the way you have it waiting for the specific dialog and text field.

            Thanks again!