Copy link to clipboard
Copied
I have an ScriptUI button that adds a single selected comp to the render queue and applies an Output module and Render module…
var comp = app.project.activeItem;
var item = app.project.renderQueue.items.add(comp);
var outputModule = item.outputModule(1);
outputModule.applyTemplate("Multi-Machine Sequence TIFF 8 Bit RGB");
item.applyTemplate("Multi-Machine Settings");
However I need to make it work for multiple selected comps.
I tried a modified version using app.executeCommand(2161); which is the Command ID for 'Add to Render Queue' but that feels like cheating haha. In any case, it doesn't quite work. It adds multiple comps, but it doesn't change the Output module. Maybe my variable syntax is wrong…
app.executeCommand(2161);
var item = app.project.renderQueue.items;
outputModule.applyTemplate("Multi-Machine Sequence TIFF 8 Bit RGB");
item.applyTemplate("Multi-Machine Settings");
Oops. I left off the first line.
var myItems = app.project.selection;
var comp, item, outputModule;
for (var i = 0; i < myItems.length; i ++){
if (! (myItems[i] instanceof CompItem)) continue;
comp = myItems[i];
item = app.project.renderQueue.items.add(comp);
outputModule = item.outputModule(1);
outputModule.applyTemplate("Multi-Machine Sequence TIFF 8 Bit RGB");
item.applyTemplate("Multi-Machine Settings");
}
Copy link to clipboard
Copied
If you have the comps selected in the project panel, something like this should work (not tested though):
var comp, item, outputModule;
for (var i = 0; i < myItems.length; i ++){
if (! (myItems[i] instanceof CompItem)) continue;
comp = myItems[i];
item = app.project.renderQueue.items.add(comp);
outputModule = item.outputModule(1);
outputModule.applyTemplate("Multi-Machine Sequence TIFF 8 Bit RGB");
item.applyTemplate("Multi-Machine Settings");
}
Copy link to clipboard
Copied
Oops. I left off the first line.
var myItems = app.project.selection;
var comp, item, outputModule;
for (var i = 0; i < myItems.length; i ++){
if (! (myItems[i] instanceof CompItem)) continue;
comp = myItems[i];
item = app.project.renderQueue.items.add(comp);
outputModule = item.outputModule(1);
outputModule.applyTemplate("Multi-Machine Sequence TIFF 8 Bit RGB");
item.applyTemplate("Multi-Machine Settings");
}
Copy link to clipboard
Copied
Worked like a charm. Thanks Dan!
Copy link to clipboard
Copied
Would it be possible to also define an output name as well? [compName]_[projectName].[fileExtension]
Thank you,