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

Get sequence by name

Explorer ,
Jul 13, 2022 Jul 13, 2022

Copy link to clipboard

Copied

I'm trying to reference an already existing sequence by name. I've found a way round it by looping through the project untill a name matches:

 

for (var d=0; d<proj.rootItem.children.numItems; d++){
var ditem = proj.rootItem.children[d];
var dname = ditem.name;
	if (dname == "MySequence" && ditem.isSequence()) {
		var MySeq = ditem;
	}
}

 

 However, it doesn't interpret the object as a sequence, this code outputs MySequence = [object Sequence]:

 

alert(MySeq.name + " = " + MySeq);

 

Whereas this outputs MySequence = [object ProjectItem]

alert(tempseq.name + " = " + app.project.activeSequence);

Any clues how to firce it to interpret MySeq as a Sequence? 

TOPICS
SDK

Views

149

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

Contributor , Jul 13, 2022 Jul 13, 2022

It doesnt interpret it as an object sequence, because it is an object projectItem (you iterate through project items). Project item could be a clip, a bin or a sequence.

 

To speed up the process you can iterate through:

app.project.sequences // it is a collection of all sequences in project

Also, if you are matching one sequence to another I would use sequenceID to get proper sequence, instead of a name (there could be duplicates). 

Votes

Translate

Translate
Explorer ,
Jul 13, 2022 Jul 13, 2022

Copy link to clipboard

Copied

Sorry, I got muddled with alerts ther -  [object Sequence] and [object ProjectItem] other way round

(I cannot edit this post for some bizarre reason)

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
Contributor ,
Jul 13, 2022 Jul 13, 2022

Copy link to clipboard

Copied

LATEST

It doesnt interpret it as an object sequence, because it is an object projectItem (you iterate through project items). Project item could be a clip, a bin or a sequence.

 

To speed up the process you can iterate through:

app.project.sequences // it is a collection of all sequences in project

Also, if you are matching one sequence to another I would use sequenceID to get proper sequence, instead of a name (there could be duplicates). 

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