Copy link to clipboard
Copied
I need to make automated video creation using javascript from small videos.
The main problem is that i can't find any proper documentation...
For example this will receive error:
folder = new Folder('C:\Users\dangerd\Desktop\Test');
var tempFiles = folder.getFiles(function(f) { return f instanceof File; });
While this works well: (folderPath variable is somehow defined)
new Folder('C:\Users\dangerd\Desktop\Test');
var tempFiles = folderPath.getFiles(function(f) { return f instanceof File; });
okay, that's weird...
So next question, how i can import all files from specified directory and put them into timeline with simple transitions between them and export video?
The first snippet ("this will receive error") works fine, here.
> how i can import all files from specified directory
In the above example, you would call importFiles(), passing in an array of file paths...which you can obtain, in your example, via tempFiles[a].fsName (where 'a' is less than the number of items in the tempFiles array).
>...put them into the timeline
Here's how to insert: https://github.com/Adobe-CEP/Samples/blob/63f176a4903b9be9e6aa73133ae689a3904f78c8/PProPanel/jsx/PPRO/Premiere.jsx#L1655
Copy link to clipboard
Copied
The first snippet ("this will receive error") works fine, here.
> how i can import all files from specified directory
In the above example, you would call importFiles(), passing in an array of file paths...which you can obtain, in your example, via tempFiles[a].fsName (where 'a' is less than the number of items in the tempFiles array).
>...put them into the timeline
Here's how to insert: https://github.com/Adobe-CEP/Samples/blob/63f176a4903b9be9e6aa73133ae689a3904f78c8/PProPanel/jsx/PPR...
> with simple transitions
There's no method for applying transitions, within PPro's supported public DOM.
Copy link to clipboard
Copied
First snippet doesn't works, it shows 0 files while second returns videos count
Copy link to clipboard
Copied
I've confirmed that this snippet works correctly.
var folder = new Folder('/Users/bbb/Desktop/testtest');
var tempFiles = folder.getFiles(function(f) { return f instanceof File; });
for (var a = 0; a < tempFiles.length; a++) {
var pathToThisFile = tempFiles[a].fsName;
}
Copy link to clipboard
Copied
Will you plan to add transition setting using javascript?
I need to automate full video creation without user interaction at all.
Currently i'm using MLT framework, but it's very limited...
P.S. It doesn't work for me anyway (v.15 build 41) maybe i need to update it...
Copy link to clipboard
Copied
> Will you plan to add transition setting using javascript?
Yes, applying transitions via ExtendScript has been a requested feature, for some time. It's unlikely to be implemented until after we've moved PPro's API to UXP.
> P.S. It doesn't work for me anyway (v.15 build 41) maybe i need to update it...
Updating isn't the issue; there have been no recent changes to the API.
On line 1, you might try double backslashes for the path to work correctly; C:\\Users\\Dangerd\\...
Sorry, I have no idea what the MLT framework is. 🙂