What would be the best way to move a section up/down across tracks in PT?
Premiere Pro has a command (I think it's called nudge up/down one track or something) that I find handy. You can select a clip or a collection of clips, press the command and it moves the selection up or down one track at a time. I have it assigned to my thumb buttons on my mouse.
I simulate something similar in PT stringing together command-x - p/; - command-v. It works pretty well, but the main limitation is it only works with a single clip. Making a selection of more than one clip, the selection is broken before you are able to paste to the adjacent track.
Is there a way a SF command could achieve this better?
Linked from:
- OOwen Granich-Young @Owen_Granich_Young
Yeah, use Menu items and For Loops.
I've been slowy building out a perspective cut package but here's the tools for what you want.
function extendEditDown(repetitions) { for (let i = 0; i < repetitions; i++) { sf.ui.proTools.menuClick({ menuPath: ["Edit", "Selection", "Extend Edit Down"], }); } } function extendEditup(repetitions) { for (let i = 0; i < repetitions; i++) { sf.ui.proTools.menuClick({ menuPath: ["Edit", "Selection", "Extend Edit Up"], }); } } function removeEditTop(repetitions) { for (let i = 0; i < repetitions; i++) { sf.ui.proTools.menuClick({ menuPath: ["Edit", "Selection", "Remove Edit from Top"], }); } } function removeEditBottom(repetitions) { for (let i = 0; i < repetitions; i++) { sf.ui.proTools.menuClick({ menuPath: ["Edit", "Selection", "Remove Edit from Bottom"], }); } } function cutToClipboard() { sf.ui.proTools.menuClick({ menuPath: ["Edit", "Cut"], }); } function pasteCliboard(){ sf.ui.proTools.menuClick({ menuPath: ["Edit", "Paste"], }); } function actionCounter({ name, waitTime, action }) { let actionCounter; if (!globalState.actionCounter) globalState.actionCounter = {}; actionCounter = globalState.actionCounter; if (!actionCounter[name]) { actionCounter[name] = { i: 1 }; } else { actionCounter[name].i++ return; } sf.engine.runInBackground(() => { sf.wait({ intervalMs: waitTime, executionMode: "Background" }); try { action(actionCounter[name].i); } finally { delete globalState.actionCounter } }); } function clipUp(){ //Get the original selected track count const originalSelectedTrackCount = sf.ui.proTools.selectedTrackCount; //Activate Pro Tools main window; sf.ui.proTools.appActivateMainWindow(); sf.ui.proTools.mainWindow.invalidate(); cutToClipboard() extendEditup(originalSelectedTrackCount) removeEditBottom(originalSelectedTrackCount) pasteCliboard() } function clipDown(){ //Get the original selected track count const originalSelectedTrackCount = sf.ui.proTools.selectedTrackCount; //Activate Pro Tools main window; sf.ui.proTools.appActivateMainWindow(); sf.ui.proTools.mainWindow.invalidate(); cutToClipboard() extendEditDown(originalSelectedTrackCount) removeEditTop(originalSelectedTrackCount) pasteCliboard() } actionCounter({ name: 'actionCounterInstance', waitTime: 250 action: i => { switch (i) { case 1: clipDown() break; case 2: clipUp() break; } } });
One click will move your clips down and 2 clicks will move your clips up. It reads the number of tracks selected and moves up and down the same number accordingly. No error checks if you don't have enough tracks above or below though, so mileage may vary.
Overall note from a novice here, I've learned in the last few months of exploring and learning from everyone here, anything you can do with Menu Click instead of Key Press (which is what we're most used to) is a more robust solution. So you can see most of the script is 'click menu item' based instead of the key commands that would normally do the same thing for us which us protools users have hardcoded into our brains.
Hope this helps,
OwenHey Owen!
Firstly, thanks so much for this. I had replied a week ago but I guess i didn't hit submit or something.
This works pretty well! I've got a couple of questions maybe you help with...
-
I'd love to assign the "up" version and "down" version to my mouse thumb keys, so I'm trying to understand what piece of the code I'd modify. Specifically, what piece of the code pertains to the click/double click action? I think I'd substituting a keystroke trigger is my only option with my my logitech MX Master 3 Mouse.
-
The other thing has to do with moving selections between mono and stereo tracks. Its a smaller point as I can just remember to be mindful of the behavior. But there is an issue that can arise between the number of tracks the command "reads" and the number of tracks it needs to move to...
For example, if moving from 2 mono to 1 stereo, it works out as I'd expect it to. Though it selects two destination tracks, the paste command puts both mono tracks on the stereo track.
But when moving from a stereo to two mono tracks, it doesn't work out because the initial "read" only assumes a single track, but one would need two mono tracks to receive a single stereo file.
....
That said, messing around moving between stereo and mono is a can of worms anyway, obviously.... But I throw it out there more just in the spirit of learning how to problem solve scripts in case you (or anyone) had an idea about how to modify it.
Thanks again!
- OOwen Granich-Young @Owen_Granich_Young
Hi DHL,
So something It took me a while to understand and it might help when looking at these things (or you alreayd know and go DUH)
function
are little tool blocks that don't do anything they just define someting. So you can see the top of this code is a bunch of diffrentfunction
and then to actually run the scirpt you use the fuction name. So in this case I built a bunch of funcitons including clipUp() and clipDown() which are the only two things you actually need to trigger the script. So if you scroll all the way to the bottom of the below script you'll see at the very end after defining all the things all it takes to run the scrips isclipUp()
and then instead if you'd like the down version I've defined that funciton as
clipDown()
so make a copy of the scripte delete the clipUp() and remove the \\ from in front of theclipDown()
to instead trigger down. Sense making?function extendEditDown(repetitions) { for (let i = 0; i < repetitions; i++) { sf.ui.proTools.menuClick({ menuPath: ["Edit", "Selection", "Extend Edit Down"], }); } } function extendEditup(repetitions) { for (let i = 0; i < repetitions; i++) { sf.ui.proTools.menuClick({ menuPath: ["Edit", "Selection", "Extend Edit Up"], }); } } function removeEditTop(repetitions) { for (let i = 0; i < repetitions; i++) { sf.ui.proTools.menuClick({ menuPath: ["Edit", "Selection", "Remove Edit from Top"], }); } } function removeEditBottom(repetitions) { for (let i = 0; i < repetitions; i++) { sf.ui.proTools.menuClick({ menuPath: ["Edit", "Selection", "Remove Edit from Bottom"], }); } } function cutToClipboard() { sf.ui.proTools.menuClick({ menuPath: ["Edit", "Cut"], }); } function pasteCliboard(){ sf.ui.proTools.menuClick({ menuPath: ["Edit", "Paste"], }); } function clipUp(){ //Get the original selected track count const originalSelectedTrackCount = sf.ui.proTools.selectedTrackCount; //Activate Pro Tools main window; sf.ui.proTools.appActivateMainWindow(); sf.ui.proTools.mainWindow.invalidate(); cutToClipboard() extendEditup(originalSelectedTrackCount) removeEditBottom(originalSelectedTrackCount) pasteCliboard() } function clipDown(){ //Get the original selected track count const originalSelectedTrackCount = sf.ui.proTools.selectedTrackCount; //Activate Pro Tools main window; sf.ui.proTools.appActivateMainWindow(); sf.ui.proTools.mainWindow.invalidate(); cutToClipboard() extendEditDown(originalSelectedTrackCount) removeEditTop(originalSelectedTrackCount) pasteCliboard() } clipUp() /// this is for up ///clipDown() //// Delete or comment out the clip up above and remove the comment hash's here for clipDown - let me know if that makes sense
As to the stereo thing ... yeah a script thats intelligent enough to know what the desination tracks are is a bit beyond me. If you check out my AAF Organizer package in there I have made a toggle for (is this stereo to mono tracks) but it's fixed it's not smart. I just did it with multiplication. Since a big part of my workflow with that script is sending stereo ADR tracks to paired mono ADR tracks.
Hope this helps!
Owen - In reply toDJH⬆:OOwen Granich-Young @Owen_Granich_Young
PS not sure if it matters but Click/double click will work with a keystroke too. I should probably have said Tap/doubleTap
-