Copy link to clipboard
Copied
I've created a script that replaces text in multiplt text layers from a csv text file, creates a new comp from each row in the text file, names the comp from the last field in the row.
At the end of the loop I'd like to add the comp to the render cue. Can't figure out how to get that started. Whatever I put in stops the script and I only end up with one new comp from the text file.
Here's the lines of code that duplicate the comp.
for(x=1; x < elementLength; x++){
//dupe the comp of interest
var compElement = selectedItemInfo.source.duplicate();
var compElementName = '';
Then there are a few lines that generate a name for the comp based on the last field in the csv text file.
Should I be putting my add to render cue script right after the cupe comp section or should it be after the name is added.
Here's the end of create comp name code.
for(i=1; i <= layers.length; i++){
for(j=0; j < matchingLayers.length; j++){
if(layers.name == matchingLayers
.name){ compElement.layers.sourceText.setValue(data
); }
//add comp to render cue
Any pointers would be appreciated. This scripting thing is not part of my usual workflow.
Adding a single comp to the Render Queue is done...
app.project.renderQueue.items.add(myComp);
For multiple comps, place it in a loop.
for(i=0; i<myComps.length; i++){
app.project.renderQueue.items.add(myComps);
}
It looks like your loop may work this way if you are processing each completely before moving on to the next one.
...
for(i=1; i <= layers.length; i++){
for(j=0; j < matchingLayers.length; j++){
if(layers.name == matchingLayers.name){
compElement.layers.sourc
Copy link to clipboard
Copied
Adding a single comp to the Render Queue is done...
app.project.renderQueue.items.add(myComp);
For multiple comps, place it in a loop.
for(i=0; i<myComps.length; i++){
app.project.renderQueue.items.add(myComps);
}
It looks like your loop may work this way if you are processing each completely before moving on to the next one.
for(i=1; i <= layers.length; i++){
for(j=0; j < matchingLayers.length; j++){
if(layers.name == matchingLayers.name){
compElement.layers.sourceText.setValue(data);
}
//add comp to render cueapp.project.renderQueue.items.add(
compElement
);
Copy link to clipboard
Copied
Thanks very much. I kind of had that, but there were typo's and it was in the wrong place in the brackets.
Rick