Skip to main content
Participant
February 23, 2024

After Effects 24.2.1 exportAsMotionGraphicsTemplate() not returning correct value

  • February 23, 2024
  • 8 replies
  • 967 views

in After Effects 24.2.1, and also the previous Version (24.1.x) exportAsMotionGraphicsTemplate() is not returning the correct value, when build into an alert or if-statement.

 

in 22.x and currently 23.6.2 exportAsMotionGraphicsTemplate() returnes 'true' upon successfully finishing the export progress. in 24.2.1. the same script returns 'false'

 

also i think in the future it should be possible to disable 'include video previews' via scripting.

 

Thank you very much!

8 replies

Inspiring
February 6, 2025

This would only work if the Javacsript engine throws an error though, right? It isn't throwing an error, the export call is just returning an incorrect value before the operation is complete.

Participant
February 6, 2025

also saveProject(); is a custom function. try app.project.save(); instead.

Participant
February 6, 2025

You can check, if a try{}catch(err){} struckture inside of a helper function works for you as well.

However: our system runs on AE 23.5x52 right now.

 

function exportMogrt(comp, replace, filePath) {
    comp.motionGraphicsTemplateName = comp.name;
    comp.openInEssentialGraphics();
    saveProject();
    try {
      comp.exportAsMotionGraphicsTemplate(replace, filePath);
    } catch (err) {
      //alert("Optional Error Message");
    }
  };

 

Inspiring
February 4, 2025

Short of a fix for this, would it possible to get some ideas for workarounds? Right now the best I can come up with is a while loop checking that the MOGRT file was actually written before making the next export call.

Inspiring
February 4, 2025

The CompItem.exportAsMotionGraphicsTemplate() function is returning a value (always false, regardless of apparent success) before the MOGRT has finished exporting. This appears to be causing subsequent export calls to fail, making reliable batch MOGRT export difficult if not impossible.

 

I am seeing this behavior in AE 24.3 on Windows 10 and in AE 25.1 on MacOS 15..2.

 

Upon calling CompItem.exportAsMotionGraphicsTemplate(), after the project is collected and the "Creating Motion Graphics Template" progress bar completes there is a significant delay before the final export operation (marked by the "Exporting Motion Graphics Template" progress bar) is carried out.

 

The script I'm using to test this with is:

 

function simpleMogrtExportTest(compToExport)
{

	var exportFolder = Folder.selectDialog("Choose a folder to which to export the MOGRT", Folder.myDocuments);
	var success = compToExport.exportAsMotionGraphicsTemplate(true, exportFolder.fsName);
	alert("Success == " +success);
}

simpleMogrtExportTest(app.project.selection[0])

 

Kevin-Monahan
Community Manager
Community Manager
February 4, 2025

Hi @A. Cobb,

I reported this to the team. It appears that this issue is still being worked on. I did report it and hope we hear back from them shortly. Sorry for the problem.

 

Thanks,
Kevin

 

Kevin Monahan - Sr. Community and Engagement Strategist – Adobe Pro Video and Audio
Inspiring
January 15, 2025

Hi @JohnColombo17100380 if there is any progress on this?
There is already a release of After Effects 2025, but MOGRT is still not exported using the api

Participant
May 17, 2024

Hi John,

 

Thank you very much for investigating this issue.

This will be of great help for maintaining the compatability of future scripts.

 

Best,

David

JohnColombo17100380
Community Manager
Community Manager
May 3, 2024

Hi @David31845386uz6e,

Thank you for reporting this issue. We are able to reproduce it on our side and have opened a ticket to investigate potential fixes. We will update this thread with any new information.

 

Thanks again,

- John, After Effects Engineering Team