ExtendScript: Apply template not working?
I am quite new to AE scripting though I have made a lot of ExtendScripts for Photoshop and Indesign. Now, I am trying to set up a workflow where I add a comp to the render queue and render it. As far as I understand, the only way to specify a Codec is by specifying a template. However, I only get an error that it's "not a valid template name". Just as a way to duoble check and eliminate any typos, I used the list of template names as an input but still get that very same error. Do anyone know if there is a way around this?
My example:
// add to render queue:
project.renderQueue.items.add(comp);
// getting an actual template name:
var template = project.renderQueue.item(1).outputModule(1).templates[10];
// trying to set the template
project.renderQueue.items.add(comp).applyTemplate(template);
