Skip to main content
dulajun
Inspiring
April 26, 2023
Answered

Bridge Talk from Adobe Bridge to AME

  • April 26, 2023
  • 1 reply
  • 357 views

I want to execute the following code in AME but from Adobe Bridge startup script. How to do that and what is the appName in BridgeTalk.getSpecifier ("appName");

And how to make a function and use talkAME.body = funObj.ToString (); and pass the parameters?

 

 

var preset = "C:\\full\\path\\to\\HighQuality720HD.epr";
var destination = "C:\\full\\path\\to\\Output";
var compItem = "C:\\full\\path\\to\\Two comps.aep";

var frontend = app.getFrontend();
if (frontend) {
  // listen for batch item added event
  frontend.addEventListener("onItemAddedToBatch", function (eventObj) {
    $.writeln("frontend.onItemAddedToBatch: success");
  });

  var batchItemSuccess = frontend.addCompToBatch(compItem, preset, destination);
  if (batchItemSuccess) {
    $.writeln(
      "Frontend script engine added the source file ",
      compItem,
      " successfully "
    );

    // get encoderHost to be able to listen for the item complete event
    encoderHost = app.getEncoderHost();
    if (encoderHost) {
      encoderHost.addEventListener("onItemEncodeComplete", function (eventObj) {
        $.writeln("Result: " + eventObj.result);
        $.writeln("Source File Path: " + eventObj.sourceFilePath);
        $.writeln("Output File Path: " + eventObj.outputFilePath);
      });

      encoderHost.runBatch();
    } else {
      $.writeln("encoderHost not valid");
    }
  } else {
    $.writeln("batch item wasn't added successfully");
  }
} else {
  $.writeln("frontend not valid");
}

 

 
Correct answer Justin Taylor-Hyper Brew
Here's an example of running a code snippet in AME from another app:
 
var bt = new BridgeTalk();
bt.target = "ame";
bt.body = "alert('hello world')";
bt.send();

1 reply

Justin Taylor-Hyper Brew
Community Expert
May 22, 2023
Here's an example of running a code snippet in AME from another app:
 
var bt = new BridgeTalk();
bt.target = "ame";
bt.body = "alert('hello world')";
bt.send();