Copy link to clipboard
Copied
I would like to just enter the path to a directory and get ExtendScript to import all the video files into my Premiere Pro.
I've gotten as far as getting them to load if I write the array out myself.
var myFiles = ["C:/Users/ooo/Documents/video_two.mov", "C:/Users/ooo/Documents/video_one.avi"];
app.project.importFiles(myFiles);
How can I get it to load all the files just by giving it the 'C:/Users/ooo/Documents/' directory?
BONUS QUESTION: Is this where everything on the web comes to ask about scripting in Premiere Pro? There aren't any tags for scripting and I had trouble finding posts specificly about scripting.
Copy link to clipboard
Copied
I got it by adding iterating over the items and passing the full path name with `fsName` because Folder, and/ or getFiles seems to cut the string in half and put a ~/ at the beginning, which Premiere Pro scripting doesn't go for. Though After Effects scripting takes truncated path names like that.
myFolder = Folder("C:/Users/ooo/Desktop/").getFiles("*.avi")
for (var i = 0; i < myFolder.length; i++) {
app.project.importFiles(myFolder[i].fsName);
}