ExtendScript - Premiere - Open Sequence Without Its ID
I have a variable that I’ve targeted by means of using for loops and if statements.
And, I happen to know it’s a sequence.
But, from what I know of ExtendScript (and it’s not that much), I’m under the impression I’d need the sequenceID of the sequence this variable is holding in order to open it or clone it - or whatever.
The thing is, I’m trying to work in a way that I’m just altering sequences based on the fact that they live in a particular bin. So, accessing sequences the traditional way of “app.project.sequences” doesn’t seem sensible to me.
Looking at what I have, is there a way to open a sequence without the ID?
Or, better yet, is there a way for me to conveniently access the sequence ID?
Below is the code I’ve been working with thus far:
for (i = 0; i < app.project.rootItem.children.numItems; i++) {
if (app.project.rootItem.children[i].name == "SEQUENCES") {
var theBin = app.project.rootItem.children[i];
}
}
for (j = 0; j < theBin.children.numItems; j++) {
if (theBin.children[j].name == "*ARCHIVE") {
var theArchiveBin = theBin.children[j];
theArchiveBin.setColorLabel(4);
}
if (theBin.children[j].type != ProjectItemType.BIN) {
var theSeq = theBin.children[0];
//At any given time in this "SEQUENCES" bin, there's only ever one sequence and then a bin called "*ARCHIVE" -- that's how I know "children[0]" is what I need.
}
}
//Confirming I have the correct sequence
alert(theBin.children[0].name);
//Here is where I'd like to CLONE or OPEN the sequence, but I don't have the ID!
Thanks very much!
