Copy link to clipboard
Copied
Hello guys, i have 2 questions:
1.
When a right click->nest is performed, a nested sequence is created and it remain selected in the project panel. How can i store it's reference via scripting in a variable, to manipolate it later? I thought there was something like selectedItem(), but i can't find anything with similar function.
2.
Is there a method that return if a track is empty and which?
Thank you!
Copy link to clipboard
Copied
var sequence = app.project.activeSequence;
// 1. To get selection:
var selection = sequence.getSelection();
for (var s = 0; s < selection.length; s++) {
selection[s]; // selected clip number s
}
// 2. To get empty track, iterate over them and find which one is empty.
numTracks = sequence.videoTracks.numTracks // numTracks works as lenght. To test audio, use audioTracks
while (numTracks--) {
sequence.videoTracks[numTracks].clips.numItems; // 0 if it is empty
}