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

get specific sequence with qe dom, extendscript

Explorer ,
Jul 25, 2020 Jul 25, 2020

Copy link to clipboard

Copied

Is there a way to get a specific sequence with the qe dom rather than just the active sequence? 

app.enableQE();
var seq = qe.project.getActiveSequence();
Then you will have access to: addTracks()

the problem here is im not trying to get the active sequence
 
I am trying to get sequence by a specific ID
 
This fails:

 

	for (var i = 0; i < qe.project.sequences.numSequences; i++) {
			var seq = qe.project.sequences[i];
			if (seq.sequenceID === newSeqID){
				var newSeq = seq;
			} 
		}



This works:

	for (var i = 0; i < app.project.sequences.numSequences; i++) {
			var seq = app.project.sequences[i];
			if (seq.sequenceID === newSeqID){
				var newSeq = seq;
			} 
		}​



my goal is to get the sequence using qeDOM so I can addTracks specified here:

https://community.adobe.com/t5/premiere-pro/add-a-track-in-a-sequence-extendscript/m-p/11313647?page...


I made a seperate post here just in case some one else had the same question they can find it easier let me know if I should take it down 🙂 


TOPICS
Editing , Error or problem , How to , SDK

Views

2.8K

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 3 Correct answers

Adobe Employee , Jul 27, 2020 Jul 27, 2020

QE DOM remains, officially, unsupported.

I think you may have better luck trying to find a QE DOM sequence based on its .guid member...

 

app.enableQE();
var newSeq = qe.project.getActiveSequence();
var newSeqID = newSeq.guid;

for (var i = 0; i < qe.project.numSequences; i++) {
	var seq = qe.project.getSequenceAt(i);
	if (seq.guid === newSeqID){
		var newSeq = seq;
	} 
}​

Votes

Translate

Translate
Adobe Employee , Jun 10, 2021 Jun 10, 2021

I feel confident in saying that no additional work is planned on the unsupported, undocumented PPro ExtendScript QE DOM. 


Votes

Translate

Translate
Adobe Employee , Aug 29, 2022 Aug 29, 2022

Strange, works here. Perhaps it's something specific to that project.

Votes

Translate

Translate
Adobe Employee ,
Jul 27, 2020 Jul 27, 2020

Copy link to clipboard

Copied

QE DOM remains, officially, unsupported.

I think you may have better luck trying to find a QE DOM sequence based on its .guid member...

 

app.enableQE();
var newSeq = qe.project.getActiveSequence();
var newSeqID = newSeq.guid;

for (var i = 0; i < qe.project.numSequences; i++) {
	var seq = qe.project.getSequenceAt(i);
	if (seq.guid === newSeqID){
		var newSeq = seq;
	} 
}​

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
Community Beginner ,
Jun 10, 2021 Jun 10, 2021

Copy link to clipboard

Copied

I just stumbled over the same problem. 

 

It seem that qe holds the sequences per bin and adjusts the numSequences count accordingly.

 

Except for the root bin/project item.

 

From what I am seeing numSequences instead holds the total count of the whole hierarchy there while every sub bin only shows the number of sequences on its own level and does not total the sub levels (which would be the correct way, given how getSequenceAt() is implemented.

 

For the following heirachy this leads to having a numSequences of 4 for qe.project, but qe.project.getSequenceAt(1) failing, since it only can access the one at index 0:

project (root bin) (numSequences=4, only one sequence accessible via getSequenceAt() despite numSequences=4)

seq1 
> bin1 (numSequences=1)
  > seq2
  > bin1_2  (numSequences=2)
    > seq3
    > seq4

 

So your example above should fail when any sequences are sorted into bins.

 

The only way I see how one could walk over all sequences is to first traverse all sub bins, count the found items and at the end ask the project bin for the remaining number of sequences.

 

Since that's bit cumbersome, it just looks like a bug in the implementation of numSequences vs getSequenceAt() on the root/project level. The count implementing a totaled perpesctive, while getSequenceAt() delivering a local one. Probably due to a mixup of the bin an project levels on that level in the QE DOM.

 

Can you confirm that this is a bug in the QE implementation?

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 ,
Jun 10, 2021 Jun 10, 2021

Copy link to clipboard

Copied

Can you confirm that this is a bug in the QE implementation?

That seems 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
Community Beginner ,
Jun 10, 2021 Jun 10, 2021

Copy link to clipboard

Copied

Ah, so fast that I couldn't even correct my typos..

 

Will that QE behaviour be "fixed" or can we rely on it staying that way and it being augmented instead? 

 

(The answer probably goes towards "rely" and "assume" not fitting the QE approach, but I give it a try...)

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 ,
Jun 10, 2021 Jun 10, 2021

Copy link to clipboard

Copied

I feel confident in saying that no additional work is planned on the unsupported, undocumented PPro ExtendScript QE DOM. 


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
Community Beginner ,
Jun 10, 2021 Jun 10, 2021

Copy link to clipboard

Copied

Thanks. Good to know. 

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 ,
Aug 27, 2022 Aug 27, 2022

Copy link to clipboard

Copied

Hi, i just let you know that this code does not work in PP2022.

Harchenko_0-1661627504650.png

 

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 ,
Aug 29, 2022 Aug 29, 2022

Copy link to clipboard

Copied

Strange, works here. Perhaps it's something specific to that project.

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 ,
Dec 22, 2022 Dec 22, 2022

Copy link to clipboard

Copied

Hi Bruce, 

This seems to be failing for me as well.

Debugging in Premiere Pro V22.0 


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 ,
Dec 22, 2022 Dec 22, 2022

Copy link to clipboard

Copied

LATEST

Never mind, it is working ! 

You can see in the screen shot, I had 

app.enableQE(); 

after the 
qe.project.getSequenceAt(0); 

app.enableQE();  ( should be before. )

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 ,
Jul 27, 2020 Jul 27, 2020

Copy link to clipboard

Copied

Thanks so much for the response! I am truly grateful. 

I create a new sequence using :

qe.project.newSequence(seqName, presetPath);
my goal is to retreive the newly created qe dom sequence object.
 
I tried :

var newSeq = qe.project.newSequence(seqName, presetPath);
 
but newSeq returns true boolean not the actual sequence object 
 
so I thought I could perhaps retreive the sequence based on the seqName string? 

Is there any better way I feel like I am close but I cant figure it out 

 

		app.enableQE();

		var seqName = 'test_sequence_new';

		// qe dom to add new sequence with pre-defined preset 
		qe.project.newSequence(seqName, presetPath);

		
		var originalSeq = $._PPP_.getSequenceByID(originalSeqID);

		// get new qe dom sequence by name 
		for (var i = 0; i < qe.project.numSequences; i++) {
			var seq = qe.project.getSequenceAt(i);
			if (seq.name === seqName){
				var newSeq = seq;
			} 
		}

 





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 ,
Jul 28, 2020 Jul 28, 2020

Copy link to clipboard

Copied

Again, QE DOM will remain officially unsupported...

 

I suspect that your new sequence will be the last sequence;  qe.project.numSequences - 1.

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 ,
Jul 28, 2020 Jul 28, 2020

Copy link to clipboard

Copied

You sir are brilliant. 

One note - when I do

var seq = qe.project.getSequenceAt(qe.project.numSequences - 1);

 

I get evalscript Error 


when I do

 

var seq = qe.project.getSequenceAt(qe.project.numSequences - 2);

 

it returns the latest created sequence successfully. 

Is there an alternative way other than QE DOM to add tracks to a newly created sequence? Since QE DOM is unsupported?

I use  
qe.project.newSequence(seqName, presetPath); 

to create a new sequence, an alternative of using  
seq.addTracks(0), I was thinking of changing the actual PProPanel.sqpreset file that I use in presetPath parameter. 

 

Using the preset file it creates 3 video tracks, but I may need a variable  N number of video tracks. 


in PProPanel.sqpreset I noticed 

<VideoTracks>[]</VideoTracks>
 
so I tried to do : 

<VideoTracks>[10]</VideoTracks>
 
but this gave evalScriptError. 

Any other way to add tracks using PProPanel.sqpreset? 

this is what my file looks like:
 
 
I followed this guide for the createSequenceFromPreset function:
https://github.com/Adobe-CEP/Samples/blob/master/PProPanel/jsx/PPRO/Premiere.jsx
 
Reference to adding tracks:
 
 
 
 

 




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