In Pro Tools, I have a clip selected. I'd like to trigger a script that enables me to select all the clips in the same track that come after the current selected clip.
I'd also like a variation on it where I can select all clips on all tracks, to the right of the current selection.
Does anyone have any pointers?
Initial selection:

Select all to the right:

- samuel henriques @samuel_henriques
Hey Andrew,
This should select from next clip, all the way to the end of last clip on track, or last clip of selected tracks.
If you want to select current start, all the way to the last clip, comment
selectFromNextClip();
Hope this helps.
sf.ui.proTools.appActivateMainWindow(); function selectFromNextClip() { const initialEnd = getSelectionEnd(); while (true) { if (initialEnd >= getSelectionEnd()) { selectNextClip(); } else { break; }; }; }; const getLength = () => sf.ui.proTools.selectionGet().selectionLength.replace(/[:.+| ]/g, ''); const getSelectionEnd = () => sf.ui.proTools.selectionGet().selectionEnd.replace(/[:.+| ]/g, ''); const extendSelToNextClip = () => sf.keyboard.press({ keys: "ctrl+shift+tab" }); const selectNextClip = () => sf.keyboard.press({ keys: "ctrl+tab" }); // Zoom to all session sf.keyboard.press({ keys: "alt+a" }); // Select from next clip to end. selectFromNextClip(); // comment this to select from current to end while (true) { const currentLenght = getLength(); extendSelToNextClip(); if (currentLenght != getLength()) { extendSelToNextClip(); } else { // Zoom to selection sf.keyboard.press({ keys: "alt+f" }); log("No more clips to select.") break; }; };
- AAndrew Sherman @Andrew_Sherman
That's really cool Samuel, thank you! Hope you're well.
Very clever to get the number of clips selected.
One thing I noticed is that after running the script, if the initial clip had fades, it doesn't seem to keep the first fade selected.
Initial selection:
Selection after running script:
I'm wondering if using zoom navigation might be of any use in this as a different approach? For example ALT A for zoom to session, ALT F for zoom to selection. And then somehow click or select to the end of the track.
samuel henriques @samuel_henriques
UPDATED: above with a fix for the faded clip not selecting the fade.
and added the zoom thing.
let me know if this is it.
samuel henriques @samuel_henriques
actually, there's still a problem if the clip has a fade at the end.
Let me think about it.samuel henriques @samuel_henriques
UPDATED above: I think this is it.
Let me know how it goes.
- AAndrew Sherman @Andrew_Sherman
That works perfectly, well done Samuel! Hope it's useful to you and anyone else.