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

Copy and Paste to new channel

By Joe Kearns @Joe_Kearns
    2022-04-21 16:14:37.672Z

    Title

    Copy and Paste to new channel

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

    Hey!

    This is a macro that will copy the clip on a channel and paste it to a set of pre-made tracks in my template and then goes back to the track i was working on.

    At the minute it jumps down to the track i want and back again it to but doesnt seem to paste. The issue seems to be with the copy and paste function.

    I have tried using 'press keys' for the copy and paste and using menu clicks but have the same issue with both

    thanks in advance!
    Joe.

    Are you seeing an error?

    What happens when you run this script?

    sorry! i explained this in the first note!

    How were you running this script?

    I used a Stream Deck button

    How important is this issue to you?

    4

    Details

    {
        "inputExpected": "Hey!\n\nThis is a macro that will copy the clip on a channel and paste it to a set of pre-made tracks in my template and then goes back to the track i was working on.\n\nAt the minute it jumps down to the track i want and back again it to but doesnt seem to paste. The issue seems to be with the copy and paste function.\n\nI have tried using 'press keys' for the copy and paste and using menu clicks but have the same issue with both\n\nthanks in advance!\nJoe.",
        "inputIsError": false,
        "inputWhatHappens": "sorry! i explained this in the first note!",
        "inputHowRun": {
            "key": "-MpfwmPg-2Sb-HxHQAff",
            "title": "I used a Stream Deck button"
        },
        "inputImportance": 4,
        "inputTitle": "Copy and Paste to new channel"
    }

    Source

    //Macro converted to script
    
    
    const firstSelectedTrackHeader = sf.proTools.trackGetFirstSelectedTrackHeader().firstSelectedTrackHeader;
    
    sf.keyboard.press({
        keys: "cmd+c",
    });
    
    sf.ui.proTools.trackGetByName({ name: "• dropfx dly1-2_throw", makeVisible: true }).track.trackSelect({
        executionMode: "Background",
        onCancel: "Abort",
    });
    
    sf.keyboard.press({
        keys: "cmd+v",
    });
    
    firstSelectedTrackHeader.trackSelect();
    
    
    

    Links

    User UID: oFSHsSUQ3KdnPd9qrQmyunuddrg1

    Feedback Key: sffeedback:oFSHsSUQ3KdnPd9qrQmyunuddrg1:-N0Btr-wPHLmVLchpbcj

    Feedback ZIP

    • 4 replies
    1. O

      Hey Joe, Check out my 'AAF Organizer' Package in the store - You want the Paste to Track Variable template.

      Create new user presets and name your tracks.

      Bests,
      Owen

      1. JJoe Kearns @Joe_Kearns
          2022-04-22 12:23:10.457Z

          Thanks Owen, will check this out as it is probably more sophisticated than my version!

          thanks!
          Joe.

        • In reply toJoe_Kearns:

          It's possible you'll need to tell Pro Tools to update its "Paste" menu before it's clickable.
          You could try inserting a keystroke like "left" (left key) before pasting, to make sure the menu is updated (PT reacts to key presses and updates its menus accordingly). And definitely would recommend switching to Edit->Copy and Paste via the menu as that should generally work better (once you figure out the bug)

          1. JJoe Kearns @Joe_Kearns
              2022-04-22 12:22:42.312Z

              Genius as Usual Christian!

              This works great

              thank you