Copy link to clipboard
Copied
Sorry, couldn't locate a specific PPro scripting forum, so I'll ask this here:
I'm writing ExtendScripts to automate the placement of clips in a sequence. As part of that, I'm doing this:
var foo = app.project.sequences[n]; // foo is now a sequence
var b = foo.clone()
The Premiere Pro scripting docs (https://premiere-scripting-guide.readthedocs.io/sequence/sequence.html) say this:
"Returns a Sequence object if successful, 0 if not."
But in fact, clone() seems to return a Boolean. The sequence does get cloned, but I don't get a reference to it.
Is there some way to find a reference to the newly-created sequence without looping through app.project.sequences[] and checking to see if each sequence name is "... Copy"? Or is there a better way to clone a sequence?
Thanks!
When given a choice between trusting docs or actual code, trust the code. 🙂 I'll fix the docs.
sequence.clone() creates a clone, and returns a boolean indicating whether or not the cloning was successful.
No, there is no way to find the newly-created sequence, other than looping through app.project.sequences.
Copy link to clipboard
Copied
Hei
I've got the same problem.
with "app.project.sequences[index].createSubsequence(ignoreChannelMapping)" you got the same result as with clone()
AND here comes a sequence object back. It also works with app.project.activeSequence etc.
hopefully this helps you.
var activeSeq = app.project.activeSequence;
activeSeq.createSubsequence();
Copy link to clipboard
Copied
When given a choice between trusting docs or actual code, trust the code. 🙂 I'll fix the docs.
sequence.clone() creates a clone, and returns a boolean indicating whether or not the cloning was successful.
No, there is no way to find the newly-created sequence, other than looping through app.project.sequences.
Copy link to clipboard
Copied
Thanks @Bruce Bullis and @fabianfaveleen. Both methods seem to work for me. And @Bruce Bullis I'm very familiar with how hard it is to make sure that docs are correct ;).