Export to AME and start right away using JSFL from Adobe Animate
Using some JSFL code that @JoãoCésar17023019 posted.I want to export a folder of .FLA files to Adobe Media Encoder (ame) and start the ame right away. At the moment my .jsfl sends it to the ame fine but the user has to start the queue.
var uri = fl.scriptURI.substr(0, fl.scriptURI.lastIndexOf('/')); // get the directory path of the currently executing script
var source = uri + "/_source";
var files = FLfile.listFolder(source + "/*.fla", "Files.");
var total = files.length;
var dom, i;
try
{
for (i = 0; i < total; i++)
{
fl.openDocument(source + "/" + files[i]);
dom = fl.getDocumentDOM();
dom.exportVideo(source + "/" + files[i].slice(0, -4) + ".mov", true, false, true, dom.timelines[0].frameCount);
dom.close(false);
// Get the path of the output file
var outputFile = source + "/" + files[i].slice(0, -4) + ".mp4";
// Add the output file to the encoding queue and start the encoding job
var queue = ame.getQueue();
var enc = queue.createEncoder("my_encoder");
enc.setSettingsPreset("H.264");
enc.setOutputFile(outputFile);
queue.queueIn(AMEFile(outputFile));
queue.startEncoding();
}
}
catch(error)
{
fl.trace(files);
fl.trace(error);
fl.trace("___________");
}
