Skip to main content
Participant
December 4, 2023
Question

Getting the to be rendered filename extension with Extendscript

  • December 4, 2023
  • 1 reply
  • 366 views

Is there a way to get the file extension in extend script that the outputModule will render a composition as?

I found the line below in the docs, but the format isn't exactly what I need and I haven't been able to find much more by using the docs.  It doens't have to be from the outputModule, but that's the closest I've come to finding something.

 

var current_format = app.project.renderQueue.item(1).outputModule(1).getSettings(GetSettingsFormat.STRING).Format;

 

For a use case example, a user can use my extension to render a composition that is then uploaded to storage. I can build the path up until the file name extension (.mp4, .avi, etc.), but I haven't figured out a way to build the final part of the path like I can in Premiere. 

var current_format = app.project.renderQueue.item(1).outputModule(1).getSettings(GetSettingsFormat.STRING).Format;

And in case I didn't explain that well, here's what I'm hoping to do:

 

var rqItem = app.project.renderQueue.items.add(comp);
var fileExtension = rqItem.outputModule(1).getFileExtension() (ex. returns ".mp4")
var outputPath = "/path/to/file/" + rqItem.name + fileExtension
rqItem.outputModule(1).file = new File(outputPath)

 

 

The ES docs that I referenced before: https://ae-scripting.docsforadobe.dev/renderqueue/outputmodule.html#outputmodule-getsettings

This topic has been closed for replies.

1 reply

Participant
December 4, 2023

I just found the answer to my own question, but can't seem to delete this post. For anyone else looking, there's an "Output File Info" object in settings that has that info.