Skip to main content
Participant
September 10, 2025
Answered

How to programmatically add AEP/AEPX to AME 2024/2025 without launching After Effects?

  • September 10, 2025
  • 1 reply
  • 282 views

I’m building an external Electron/NodeJS app and need to add a populated After Effects project (.aepx) directly into Adobe Media Encoder’s queue without launching After Effects.

What I tried:

  • Starting AME and attempting to run ExtendScript via command line: --console es.executeScript, es.executeScript=, and -r script.jsx
  • Inside the script: calling app.getFrontend() and app.getEncoderHost(), subscribing to onItemAddedToBatch and onBatchItemCreationFailed, and writing to a temp log file
  • AME launches, but the script never seems to run (no file writes, no events, no queue items)

Goal:
Programmatically add the .aepx to AME’s queue (ideally with preset and output) without launching AE.

Questions:

 

  1. Is there a supported way in AME 2024/2025 to execute ExtendScript from command line so it runs in the AME host?

  2. What is the recommended method to queue AE projects in AME without opening AE?

  3. If CLI script execution is not supported, should we use a CEP/UXP panel or Watch Folders instead?

  4. Can anyone share a minimal “Hello World” example that runs JSX in AME 2025 and writes to a file to confirm execution?

Environment:
Windows 10, AME 2025, AE installed (not used), Electron/NodeJS app.

Thanks for any guidance.

Correct answer SükriyeLudwig

Hi,
I assume that you have ExtendScript Debugger Plugin. 

 

If so, 
try this code please. Consider also that  we can not use "H.264/HEVC" format via Scripting anymore. 

// The projectPath can be a path to an AfterEffects, Premiere Pro or Character Animator project
var format = "";
var projectPath = "C:\\testdata\\aeCompTest.aep";
var preset = "C:\\testdata\\HighQuality720HD.epr";
var destination = "C:\\testdata\\outputFolder";

// //sources for mac
// var projectPath = "/Users/Shared/testdata/aeCompTest.aep"
// var preset = "/Users/Shared/testdata/HighQuality720HD.epr";
// var destination = "/Users/Shared/testdata/outputFolder";

var frontend = app.getFrontend();
if (frontend) {
  // first we need the guid of the e.g. ae comps or ppro sequences
  var result = frontend.getDLItemsAtRoot(projectPath);
  $.writeln(result.length + " comps / sequences found.");

  // import e.g. the first comp / sequence
  if (result.length > 0) {
    // listen for batch item added / creation failed event
    frontend.addEventListener("onItemAddedToBatch", function (eventObj) {
      $.writeln("frontend.onItemAddedToBatch: success");
    });

    frontend.addEventListener("onBatchItemCreationFailed", function (eventObj) {
      $.writeln("frontend.onBatchItemCreationFailed: failed");
      $.writeln("srcFilePath: " + eventObj.srcFilePath);
      $.writeln("error: " + eventObj.error);
    });

    var encoderWrapper = frontend.addDLToBatch(
      projectPath,
      format,
      preset,
      result[0],
      destination
    );

    if (encoderWrapper) {
      $.writeln(
        "Batch item added successfully for comp / sequence guid: ",
        result[0]
      );

      // listen for encode progress and encode finish events
      encoderWrapper.addEventListener("onEncodeProgress", function (eventObj) {
        $.writeln("Encoding progress for batch item: " + eventObj.result);
      });

      encoderWrapper.addEventListener("onEncodeFinished", function (eventObj) {
        $.writeln("Encoding result for batch item: " + eventObj.result);
      });

      // get encoder host to run batch
      var encoderHost = app.getEncoderHost();
      if (encoderHost) {
        encoderHost.runBatch();
      } else {
        $.writeln("encoderHost not valid");
      }
    } else {
      $.writeln("encoderWrapper not valid");
    }
  } else {
    $.writeln("the project doesn't have any comps / sequences");
  }
} else {
  $.writeln("frontend not valid");
}

 


and you can explore this documentation for more help -> https://ame-scripting.docsforadobe.dev/
Here is a description on how you can execute scripts via console:
https://ame-scripting.docsforadobe.dev/guide/index.html#how-do-i-run-scripts-in-ame

best, 

Sue

1 reply

SükriyeLudwigCommunity ManagerCorrect answer
Community Manager
September 10, 2025

Hi,
I assume that you have ExtendScript Debugger Plugin. 

 

If so, 
try this code please. Consider also that  we can not use "H.264/HEVC" format via Scripting anymore. 

// The projectPath can be a path to an AfterEffects, Premiere Pro or Character Animator project
var format = "";
var projectPath = "C:\\testdata\\aeCompTest.aep";
var preset = "C:\\testdata\\HighQuality720HD.epr";
var destination = "C:\\testdata\\outputFolder";

// //sources for mac
// var projectPath = "/Users/Shared/testdata/aeCompTest.aep"
// var preset = "/Users/Shared/testdata/HighQuality720HD.epr";
// var destination = "/Users/Shared/testdata/outputFolder";

var frontend = app.getFrontend();
if (frontend) {
  // first we need the guid of the e.g. ae comps or ppro sequences
  var result = frontend.getDLItemsAtRoot(projectPath);
  $.writeln(result.length + " comps / sequences found.");

  // import e.g. the first comp / sequence
  if (result.length > 0) {
    // listen for batch item added / creation failed event
    frontend.addEventListener("onItemAddedToBatch", function (eventObj) {
      $.writeln("frontend.onItemAddedToBatch: success");
    });

    frontend.addEventListener("onBatchItemCreationFailed", function (eventObj) {
      $.writeln("frontend.onBatchItemCreationFailed: failed");
      $.writeln("srcFilePath: " + eventObj.srcFilePath);
      $.writeln("error: " + eventObj.error);
    });

    var encoderWrapper = frontend.addDLToBatch(
      projectPath,
      format,
      preset,
      result[0],
      destination
    );

    if (encoderWrapper) {
      $.writeln(
        "Batch item added successfully for comp / sequence guid: ",
        result[0]
      );

      // listen for encode progress and encode finish events
      encoderWrapper.addEventListener("onEncodeProgress", function (eventObj) {
        $.writeln("Encoding progress for batch item: " + eventObj.result);
      });

      encoderWrapper.addEventListener("onEncodeFinished", function (eventObj) {
        $.writeln("Encoding result for batch item: " + eventObj.result);
      });

      // get encoder host to run batch
      var encoderHost = app.getEncoderHost();
      if (encoderHost) {
        encoderHost.runBatch();
      } else {
        $.writeln("encoderHost not valid");
      }
    } else {
      $.writeln("encoderWrapper not valid");
    }
  } else {
    $.writeln("the project doesn't have any comps / sequences");
  }
} else {
  $.writeln("frontend not valid");
}

 


and you can explore this documentation for more help -> https://ame-scripting.docsforadobe.dev/
Here is a description on how you can execute scripts via console:
https://ame-scripting.docsforadobe.dev/guide/index.html#how-do-i-run-scripts-in-ame

best, 

Sue

Participant
September 10, 2025

Hi Sue — thank you very much for your time and help.

yes i have ExtendScript Debugger installed.

 

What we changed based on your guidance and the AME guide

  • CLI: Updated to use the documented flag to run scripts in AME:
  • We now call AME with --console es.processFile <path-to-script.jsx> first (and still try legacy fallbacks if needed).
  • Reference: AME Scripting Guide (How do I run scripts in AME?) https://ame-scripting.docsforadobe.dev/guide/index.html#how-do-i-run-scripts-in-ame
  • Preset: Created a ProRes .epr preset in AME and saved it to a stable folder. We point our app to that absolute .epr path (avoiding H.264/HEVC).
  • Frontend API: Rewrote our AME-side JSX to follow your pattern:
  • Wait for app.getFrontend() and app.getEncoderHost() to be available (up to ~30s).
  • Use frontend.getDLItemsAtRoot(projectPath) to get items (AE comps/PR sequences).
  • Call frontend.addDLToBatch(projectPath, format, presetPath, result[0], destination) where:
  • format = "(empty)
  • presetPath = the absolute .epr we created
  • destination = the output folder derived from our chosen output path
  • Attach event listeners:
  • frontend.onItemAddedToBatch
  • frontend.onBatchItemCreationFailed
  • encoderWrapper.onEncodeProgress / onEncodeFinished
  • If encoderHost is available, call encoderHost.runBatch().

What we tried (execution details)

  • We launch (or detect) AME and then execute JSX inside the AME host using:
  • "…Adobe Media Encoder.exe" --console es.processFile "C:\path\to\temp.jsx"
  • If that fails, we also try (legacy) --console es.executeScript "<script>", es.executeScript="<script>", and -r "<script>".
  • The JSX implements the flow above, including a small connection test and logging via $.writeln, and it should emit success/error/event lines.
  • We created and configured a ProRes .epr (non-H.264/HEVC) and passed its absolute path as the preset parameter.
  • Destination folder exists and is writable; we pass its path (folder only).

Observed behavior

  • AME launches or is already running, but our script seems to not execute at all in the AME host (no output, no event callbacks, no queue item).
  • Representative logs (note the repeated “no output”):
  • AME is already running
  • Testing AME connection via scripting API…
  • AME script output (combined): (no output)
  • Adding project to AME queue: C:\…\Sample End Page_job_20250910-2254_render.aepx → C:\…\export\Sample End Page_2025-09-10-225358.mp4
  • Adding AEPX to AME (no AE) via es.executeScript:
  • Project: C:\…\Sample End Page_job_20250910-2254_render.aepx
  • Output (destination folder will be used😞 C:\…\export\Sample End Page_2025-09-10-225358.mp4
  • AME script output (combined): (no output)
  • Failed to add AEPX to AME via scripting: Error: Unknown error
  • No “onItemAddedToBatch” event, no “onBatchItemCreationFailed” details, and no enqueue in AME UI.

Notes

  • We avoided watch folders on purpose to stay aligned with your recommendation and the guide.
  • We ensured the preset path is a valid .epr file (ProRes) and the destination is a folder.
  • We attempted while AME was already running; we also previously tried launching AME via our app with CLI arguments. In both cases, the script appears not to be processed.

Next questions (if helpful)

  • On AME 202(Windows), should --console es.processFile work reliably when an instance is already running, or do CLI arguments only apply when launching a fresh instance?
  • For .aepx specifically, is getDLItemsAtRoot the right API (versus getAECompositionsGUIDFromAfterEffectsProjectPath) for modern AME?
  • Are there any AME-side preferences/permissions we need to enable for CLI script execution?
  • Any known constraints for Dynamic Link when queuing AE comps from AME without opening AE?

Thank you again for the guidance and the sample.