I am fully aware that Adobe does not "officially" support Media Encoder scripting through ExtendScript in the way they do for most of the other applications. But it is possible:
However, it only seems that the script can be run by opening up the ExtendScript Toolkit and manually clicking the green arrow which causes the script to run.
Naturally, this is far from ideal. For other Adobe applications, such as After Effects, the script can be run from command line in the following fashion:
"C:\Program Files\Adobe\Adobe After Effects CC 2018\Support Files\afterfx.exe" -r "script/path/here.jsx"
(See here for a reference: Run .jsx File From Command Line Windows )
However, when trying the same thing for Adobe Media Encoder (replacing it with the appropriate path), no such luck. Although the Media Encoder window becomes active, the script does not run.
Another thought was to put `#target ame` at the beginning of the script and then try running it with ExtendScript directly. When doing so, you get this window:
Unfortunately, clicking "Yes" does absolutely nothing.
The goal here is to be able to run my .jsx script for Media Encoder in some kind of automated fashion, without having to open ExtendScript and manually click on the green arrow each time. Surely there's some way to do this, but apart from the methods I've tried above which don't work, I cannot think of anything. What exactly is clicking that little green arrow doing, and is there any way to emulate that click from command line? I'm willing to try anything to enable me to run this script completely automated.
For reference, I am using Adobe Media Encoder CC 2017 and Windows 10 build 14393.
For Media Encode the command is --console es.executeScript "script/path/here.jsx"
Genius! I was unable to find this information anywhere, but it worked perfectly! Thank you so much.
Just for extra clarification, here's what I tried in command prompt (CMD) on Windows and it worked:
"C:\Program Files\Adobe\Adobe Media Encoder CC 2017\Adobe Media Encoder.exe" --console es.executeScript "D:\Projects\encode_all_mxfs.jsx"
I'm just curious; how did you figure this out? I haven't been able to find this information anywhere online.
I also tried that way but it produces nothing.
"C:\Program Files\Adobe\Adobe Media Encoder CC 2017\Adobe Media Encoder.exe" --console es.executeScript "F:\AME Script Test\test.jsx"
The script works with ExtendScript Toolkit but nothing happen with command prompt method. I just see OS get focus on AME and that's all. I tried with the more simple script "alert("hello");" for no result.
AME CC 2017 / Windows 7
Does anybody have an idea ?
By the way, where did you find documentation about functions and methods provided by AME in ESTK ?
Fow now i'm stuck with associating batch file and format preset.
Import file to batch list OK, get info from file OK, set format OK, set format on file NO.
The only information i found is :
front = app.getFrontend();
enc = eHost.createEncoderForFormat("H.264");
flag = enc.loadPreset("HD 1080i 25");
but ESTK told me "encode is not a function" . . .
There is a way to run media encoder in background?