Highlighted

ExtendScript sequence.clone() returns Boolean?

Explorer ,
Nov 13, 2020

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. 

 

 

TOPICS
SDK

Views

52

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

ExtendScript sequence.clone() returns Boolean?

Explorer ,
Nov 13, 2020

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. 

 

 

TOPICS
SDK

Views

53

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Nov 13, 2020 0
New Here ,
Nov 14, 2020

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();

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 14, 2020 0
Adobe Employee ,
Nov 16, 2020

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. 

 

 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 16, 2020 0
cweger79 LATEST
Explorer ,
Nov 16, 2020

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 ;).

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 16, 2020 0