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

Auto-Align Post "Align to track upon it"

By Daniel Perez @daniel_perez
    2022-08-12 05:29:02.180Z

    Title

    Auto-Align Post "Align to track upon it"

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

    Auto-Align Post - Align to track upon it.

    Are you seeing an error?

    What happens when you run this script?

    select clip to be aligned activate script move selection up set this as key input in AAP

    How were you running this script?

    I used a keyboard shortcut within the target app

    How important is this issue to you?

    5

    Details

    {
        "inputExpected": "Auto-Align Post - Align to track upon it.",
        "inputIsError": false,
        "inputWhatHappens": "select clip to be aligned\nactivate script\nmove selection up\nset this as key input in AAP",
        "inputHowRun": {
            "key": "-Mpfwh4RkPLb2LPwjePT",
            "title": "I used a keyboard shortcut within the target app"
        },
        "inputImportance": 5,
        "inputTitle": "Auto-Align Post \"Align to track upon it\""
    }

    Source

    sf.keyboard.press({
        keys: "p",
        fast: true,
        executionMode: "Foreground",
        onCancel: "Abort",
        onError: "ThrowError",
    });
    
    
    //Open the plugin and save the plugin window to the "asWin" variable
    var asWin = sf.ui.proTools.audioSuiteOpenPlugin({
    category: 'Other',
    name: "Auto-Align Post"
    }).window;
    
    
    
    //Set processing options
    asWin.audioSuiteSetOptions({
    processingInputMode: "ClipByClip",
    processingOutputMode: "CreateIndividualFiles"
    
    });
    
    
    
    
    
        //Get first track from selection
        var name = sf.ui.proTools.selectedTrackNames[0];
    
    
        //Focus AAP
        var asWin = sf.ui.proTools.getAudioSuiteWindow("Auto-Align Post");
        asWin.elementRaise();
    
    
        //Set Key input
        sf.ui.proTools.appActivate();
        var keyInputBtn = sf.ui.proTools.firstAudioSuiteWindow.invalidate().popupButtons.whoseTitle.is('Key Input').first;
        keyInputBtn.popupMenuSelect({
        menuPath: [name]
        });
    
    
    
    
    
    
    sf.keyboard.press({
        keys: ";",
        fast: true,
        executionMode: "Foreground",
        onCancel: "Abort",
        onError: "ThrowError",
        });
    
    
    
        
    

    Links

    User UID: qxvuxIROjqhCgyum17n87NP7TKo2

    Feedback Key: sffeedback:qxvuxIROjqhCgyum17n87NP7TKo2:-N9FWjp1f5uKQwK4PZak

    Feedback ZIP

    • 6 replies
    1. Daniel Perez @daniel_perez
        2022-08-12 05:31:10.593Z2022-08-12 05:41:04.875Z

        select clip to be aligned
        activate script
        move selection up
        set this as key input in AAP (works fine!)

        • move selection down (here the script won't continue)
          (render)

        i'm looking for a working wait command.

        wait for milliseconds won't work.
        wait for no modals won't work.
        raise edit window and wait ms won't work.

        maybe, a wait for key input dropdown menu to be closed?

        1. In reply todaniel_perez:
          Daniel Perez @daniel_perez
            2022-08-12 05:41:35.492Z
            1. Try using click menu item : edit menu extend selection up and remove selection from bottom instead of key press Semi-colon

              On my phone hope that helps

              Functions for menu click to copy and paste are in here:
              What would be the best way to move a section up/down across tracks in PT?

              Bests
              Owen

            2. B
              In reply todaniel_perez:
              Brian Armstrong @Brian_Armstrong
                2023-05-25 06:23:13.226Z

                Might also be more efficient to align to track under. In other words, if you have boom on top and lav on bottom and you want to align lav to the boom, highlight the selection on the boom track, then run:

                open Auto-Align, select current track as key input, then move your selection down and render.

                Maybe?