Copy link to clipboard
Copied
Is there any way to get the list of project items which are part of the active sequence? I couldn't find such example at: Samples/Premiere.jsx at master · Adobe-CEP/Samples · GitHub
Premiere Pro version: 12.0.1
Extension Type: Panel
Thanks & Regards.
Meet Tank
There isn't sample code to do that.
Meticulous method: Walk every clip on every track, and make a record of the projectItem to which each clip refers.
Brute force method: Save the sequence as a new project, and it'll contain any/all projectItems referenced in the sequence.
As is so often the case, I prefer the brute force approach.
Copy link to clipboard
Copied
There isn't sample code to do that.
Meticulous method: Walk every clip on every track, and make a record of the projectItem to which each clip refers.
Brute force method: Save the sequence as a new project, and it'll contain any/all projectItems referenced in the sequence.
As is so often the case, I prefer the brute force approach.
Copy link to clipboard
Copied
Thanks for the quick response Bruce Bullis. Could you please elaborate more on the Brute force method? How to save the sequence as a new project? Can it be done using the Premiere Pro SDK or through Premiere Pro UI? And how to iterate through the project items after saving it as a new project?
Thanks,
Meet
Copy link to clipboard
Copied
Save sequence as new project:
Samples/Premiere.jsx at master · Adobe-CEP/Samples · GitHub
Iterate through items in a project:
Samples/Premiere.jsx at master · Adobe-CEP/Samples · GitHub
Copy link to clipboard
Copied
Thanks Bruce. However we don't want to export the sequence as a new project. Regarding the Meticulous method: "Walk every clip on every track". Did you mean walk through every track including audio and video?
Thanks,
Meet
Copy link to clipboard
Copied
I'm curious why you're averse to exporting the sequence...?
Even if you don't use the exported project for anything, exporting it will give you a project containing all the media referenced in that sequence, and only the media referenced in that sequence. Isn't that exactly the information you need?
Yes, for the meticulous method, you'd need to walk across every clip on every track, to identify its corresponding projectItem.
Copy link to clipboard
Copied
How do you want the output? Im unsure of how to write this to an external file, or the clipboard or similar...
To walk every clip in the videotracks, you can use this:
app.enableQE();
var activeSequence = app.project.activeSequence;
var videoTrackNum = activeSequence.videoTracks.numTracks;
var result = "";
for (var j = videoTrackNum - 1; j >= 0; j--){
//walk each track
var videos = activeSequence.videoTracks
var arrayLength = videos.numItems;
for (var i = 0; i < arrayLength; i++){
//walk each clip
var clip = videos;
var projectItem = clip.projectItem ;
result += projectItem.name + ", ";
}
}
alert (result);
This script will produce duplicates, if youve used a project-item twice in the sequence, and will maybe not count the last clip in the tracks? Dont know, havent debugged it.