Skip to main content
Participant
February 21, 2021
Answered

programming premiere pro with extend script

  • February 21, 2021
  • 3 replies
  • 820 views

Hi I have just started using extend script for premiere pro.
I need to know the size of an object that makes up a clip it uses
some photographs.
The script I should complete is the following:


var oggetto =app.project.rootItem;

//alert(oggetto.children[0].name );
for(i =0;i<oggetto.children.numItems;i++){
// $.writeln(i);
$.writeln(i+" "+oggetto.children[i].name ); //26 2014_10_14_21_33_29_DSC_0227.JPG
$.writeln(oggetto.children[i].children);

}

I have to get the X and Y dimensions of the photograph:
26 2014_10_14_21_33_29_DSC_0227.JPG.

Thanks for any advice.

This topic has been closed for replies.
Correct answer Bruce Bullis

Confirming: You want the dimensions of the associated projectItem, not the dimensions the media had before it was imported into PPro, correct? 

 

If so, you can get that info in the private project metadata, associated with that projectItem.

3 replies

Participant
February 24, 2021
Thanks for the prompt intervention.

My problem is to get the dimensions of the imported photo photograph
in the Premiere project.
In the following example what is missing are the domains I would like to
use for
complete lines 26-27.

var progetto = app.project;
var elementiProg = progetto.rootItem;
$.writeln(progetto.name);
$.writeln(elementiProg.children.numItems);
var immagini = cerco_immagini(elementiProg);
for(var e = 0;e$.writeln(e+' '+immagini[e].name);
//$.writeln(e+'****'+immagini[e].type);
}



function cerco_immagini(elementiProg){
var elementi =[];
var nome;
for(var i = 0; i < elementiProg.children.numItems; i++) {
nome = elementiProg.children[i].name;
if(nome.substring(nome.length - 3, nome.length).toLowerCase() == "jpg"
|| nome.substring(nome.length - 4, nome.length).toLowerCase() == "jpeg"
|| nome.substring(nome.length - 3, nome.length).toLowerCase() == "png")
{
elementi.push(elementiProg.children[i]);
//==================================================================
// How do you get these dimensions?

//$.writeln(elementiProg.children[i].width);
// $.writeln(elementiProg.children[i].height);

//==================================================================

}
}
return elementi;
}


I thank everyone and I am waiting for news..
Bruce Bullis
Legend
February 24, 2021

That information may be available in PPro's private project metadata: Here's how to access it. 

https://github.com/Adobe-CEP/Samples/blob/63f176a4903b9be9e6aa73133ae689a3904f78c8/PProPanel/jsx/PPRO/Premiere.jsx#L987

Note: That may NOT be the size of the images as used in sequences; I'm not sure what value those original dimensions will have...?

Participant
February 25, 2021

Thank you but I don't know how to use the script you sent me. I am beginner, beginner ....

Bruce Bullis
Bruce BullisCorrect answer
Legend
February 22, 2021

Confirming: You want the dimensions of the associated projectItem, not the dimensions the media had before it was imported into PPro, correct? 

 

If so, you can get that info in the private project metadata, associated with that projectItem.

R Neil Haugen
Legend
February 21, 2021

This would need staffer @Bruce Bullis  to help.

 

Neil

Everyone's mileage always varies ...