I posted this in the "macros" sticky, but I'm not sure anyone saw it....
I'm trying to create two macros:
1- After selecting any clip on a track, I can invoke the macro to select all following clips on the same track
2 - After selecting any clip on a track, I can invoke the macro to select all following clips on all tracks. (It doesn't matter if clips on other tracks that occur at the same time as the initial chosen clip are selected or not ... as long as the behavior is consistent.)
In either case, at the end of the process, the view/zoom level of the project would not have changed.
So, for macro #1, this code will select ALL clips on a track, but I don't know how to give it directionality and selectivity.
Code: Select all
var track = Tracktion.getTrackFromSelectedObject();
var clips = Tracktion.getClipsFromTracks (track);
var position = Tracktion.getPosition (selected);
Tracktion.addObjectsToSelection (clips);Code: Select all
//SELECT FOLLOWING CLIPS
var track = Tracktion.getTrackFromSelectedObject();
var clips = Tracktion.getClipsFromTracks (track);
var position = Tracktion.getPosition (selected);
var minSeparation = 0.1;
var newPosition = 36000;
for (var i = 0; i < clips.length; ++i)
{
var clipStart = parseFloat (clips[i].getProperty ('start'));
if (clipStart > position && clipStart < newPosition)
if (clipStart > (position + minSeparation))
Tracktion.addObjectsToSelection (clip[i]);
Tracktion.selectItem ('right');
newPosition = clipStart;
}
if (newPosition != 36000)
{
Tracktion.setPosition ('transport', position);
Tracktion.setViewBoundsAroundTime (position, 0.6);
}
Anyway, if anyone has a moment and is willing, I'd appreciate any insights. Thank you.
