-
Import Footage and Create Comp with Extendscript
Hey all, would love a little help here. So far I have a script that imports all the footage from a selected folder and creates comps with all the info I need. But I can’t for the life of me figure out how to get said imported footage to actually show up in my comp. As of now this script just creates comps with the proper names and info but I can’t figure out exactly how to get the footage to show up in the comp it creates- they all show up empty. Learning still and trying to get to grips with it and thought this would be a great little exercise. Any help would be appreciated.
var sourceFolder = Folder.selectDialog("Select folder with source files");// Import source files into project
var files = sourceFolder.getFiles();
for (var i = 0; i < files.length; i++) {
app.project.importFile(new ImportOptions(files[i]));
}// Array holding source footage
var sourceList = new Array();
for (var i = 1; i <= app.project.items.length; i++) {
sourceList[sourceList.length] = app.project.items[i];
}// Generate Compositions
for (var i = 0; i < sourceList.length; i++) {
var sourceFootage = sourceList[i];
var compName = sourceFootage.name.substring(0, sourceFootage.name.indexOf(".")) + "_" + i;
var newComp = app.project.items.addComp(compName, sourceFootage.width, sourceFootage.height, 1, sourceFootage.duration, sourceFootage.frameRate);
}