• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

ExtendScript sequence.clone() returns Boolean?

Explorer ,
Nov 13, 2020 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!

TOPICS
SDK

Views

585

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
community guidelines

correct answers 1 Correct answer

Adobe Employee , Nov 16, 2020 Nov 16, 2020

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. 

 

 

Votes

Translate

Translate
New Here ,
Nov 14, 2020 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();

Votes

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
community guidelines
Adobe Employee ,
Nov 16, 2020 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. 

 

 

Votes

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
community guidelines
Explorer ,
Nov 16, 2020 Nov 16, 2020

Copy link to clipboard

Copied

LATEST

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

Votes

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
community guidelines