Hi guys,
Firstly, thanks again to Christian and everyone else on the forum for all your help, Im absolutely loving the community here.
Does anybody know if theres a way to repeat a macro chain, until the end of a clip in ProTools?
For instance, I'd like to do certain actions at marker points, but is there a way to repeat those events at marker points, until the end of the clip?
I have it set up at the moment so it's a repeat process for a set number of repetitions, but just wondering if I could just point it at a clip and say 'off you go' until it gets to the end of that clip
Linked from:
- Christian Scheuer @chrscheuer2020-10-01 15:19:27.392Z
Hi Ben,
Yes, you can do that - but it's easier to help with the specific script/actions you're taking. Please share the script you have currently, and then we can add the requested behavior to it.
- BBen Zenium @Ben_Zenium
Ah yes sorry, I was a bit cryptic in that last post. It's a super simple script of just going from marker to the next marker, and separating the audio at th emarker point. Currently it does it something like 12 times but I'd like it just to run until the end of the clip and then stop.
sf.ui.proTools.memoryLocationsGotoDelta({
delta: 2,
});sf.ui.proTools.menuClick({
menuPath: ["Edit","Separate Clip","At Selection"],
});sf.ui.proTools.memoryLocationsGotoDelta({
delta: 1,
});sf.ui.proTools.menuClick({
menuPath: ["Edit","Separate Clip","At Selection"],
});sf.ui.proTools.memoryLocationsGotoDelta({
delta: 1,
});sf.ui.proTools.menuClick({
menuPath: ["Edit","Separate Clip","At Selection"],
});sf.ui.proTools.memoryLocationsGotoDelta({
delta: 1,
});sf.ui.proTools.menuClick({
menuPath: ["Edit","Separate Clip","At Selection"],
});sf.ui.proTools.memoryLocationsGotoDelta({
delta: 1,
});sf.ui.proTools.menuClick({
menuPath: ["Edit","Separate Clip","At Selection"],
});sf.ui.proTools.memoryLocationsGotoDelta({
delta: 1,
});sf.ui.proTools.menuClick({
menuPath: ["Edit","Separate Clip","At Selection"],
});sf.ui.proTools.memoryLocationsGotoDelta({
delta: 1,
});sf.ui.proTools.menuClick({
menuPath: ["Edit","Separate Clip","At Selection"],
});sf.ui.proTools.memoryLocationsGotoDelta({
delta: 1,
});sf.ui.proTools.menuClick({
menuPath: ["Edit","Separate Clip","At Selection"],
});sf.ui.proTools.memoryLocationsGotoDelta({
delta: 1,
});sf.ui.proTools.menuClick({
menuPath: ["Edit","Separate Clip","At Selection"],
});sf.ui.proTools.memoryLocationsGotoDelta({
delta: 1,
});sf.ui.proTools.menuClick({
menuPath: ["Edit","Separate Clip","At Selection"],
});sf.ui.proTools.memoryLocationsGotoDelta({
delta: 1,
});sf.ui.proTools.menuClick({
menuPath: ["Edit","Separate Clip","At Selection"],
});sf.ui.proTools.memoryLocationsGotoDelta({
delta: 1,
});sf.ui.proTools.menuClick({
menuPath: ["Edit","Separate Clip","At Selection"],
});Christian Scheuer @chrscheuer2020-10-02 10:47:39.685Z
Hi Ben,
Thanks - this makes sense. Are you working in Timecode?
- BBen Zenium @Ben_Zenium
Hi Christian. I am indeed!
- In reply tochrscheuer⬆:
Christian Scheuer @chrscheuer2020-10-02 10:53:06.014Z2020-10-02 11:44:00.997Z
If you're using Timecode, then the following should work:
//Store original selection let originalSelection = sf.ui.proTools.selectionGet(); let originalSelectionSamples = sf.ui.proTools.selectionGetInSamples(); try { //Collapse selection to the left hand side sf.ui.proTools.selectionSet({ selectionStart: originalSelection.selectionStart, selectionEnd: originalSelection.selectionStart, }); //Perform an endless loop while (true) { //Go to the next memory location let goRes = sf.ui.proTools.memoryLocationsGotoDelta({ delta: 1, onError: 'Continue', }); //If we didn't find a next memory location, just abort the loop if (!goRes.success) break; //Retrieve the selection at this point let newSelection = sf.ui.proTools.selectionGet(); //If we're now further to the right than the original selection, //break the loop if (newSelection.selectionStart > originalSelection.selectionEnd) break; //Otherwise, click Separate Clip At Selection, and continue the loop //also - if for some reason we're in between clips we're allowing the menu click to fail silently sf.ui.proTools.menuClick({ menuPath: ["Edit", "Separate Clip", "At Selection"], onError: 'Continue', }); //Continue the loop } } finally { //Finally, regardless of any error occurring in the previous code, //restore the original selection sf.ui.proTools.selectionSetInSamples({ selectionStart: originalSelectionSamples.selectionStart, selectionEnd: originalSelectionSamples.selectionEnd, }); }
I'll be including this command in an upcoming version of the "Pro Tools Utilities" package :)
- BBen Zenium @Ben_Zenium
Hey Christian, thanks so much for this. The script appears to jump to the next marker and then back to where the playhead is, with no separation either.
Christian Scheuer @chrscheuer2020-10-02 11:05:33.264Z
Hi Ben,
Here's how it looks on my end:
In the video, first I'm manually playing back in real-time to add markers.
Then I select the clip and run the script.Can you see anything you're doing differently?
- BBen Zenium @Ben_Zenium
Ah it seems to be working now!! This is amazing! Thank you Christian!! Was this something you were working on anyway or just from this thread?
Christian Scheuer @chrscheuer2020-10-02 11:43:11.793Z
Just from this thread :) Awesome that it's working for you!
Christian Scheuer @chrscheuer2020-10-02 11:43:40.416Z
I've shared this now in the Pro Tools Utilities package, so if you use it from there you'll get any updates we make to it as well.
- In reply tochrscheuer⬆:BBen Zenium @Ben_Zenium
Amazing work man, thank you so much!