Copy link to clipboard
Copied
How to change the value of text fields in R_VAR layers
each BLOCK_nn composition located in ALL_BLOCKS of the main “MAIN” composition with data from an external file
“export-data.txt”?
Tried some variations of scripts - all do not work properly.
Even command
app.project.itemByName("BLOCKS_01") - undefined
Copy link to clipboard
Copied
If you want to create your own tool with my (paid) extension Automation Blocks,
learn here, how to modify things like texts in your project:
https://docs.mamoworld.com/automation-blocks/tutorials-ae/writeCustomTemplateTool
instead of using a custom user interface, you want to read the data from a spreadsheet.
You can learn here, how to work with spreadsheet files in Automation Blocks:
https://docs.mamoworld.com/automation-blocks/tutorials-pr/mogrtFromSpreadsheet
The latter tutorial is for Premiere Pro, but the blocks to work with spreadsheets are identical in both Ae and Pr.
Copy link to clipboard
Copied
I'm not sure what the issue is, but this works for me:
function getComp(theName){
for (var i = 1; i <= app.project.numItems; i++){
if (app.project.item(i) instanceof CompItem && app.project.item(i).name == theName){
return app.project.item(i);
}
}
return null;
}
var myComp = getComp("BLOCK_01");
if (myComp){
var myTextDoc = myComp.layer("R_VAR").property("ADBE Text Properties").property("ADBE Text Document").value;
myTextDoc.text = "New Text";
myComp.layer("R_VAR").property("ADBE Text Properties").property("ADBE Text Document").setValue(myTextDoc);
}else{
alert("Can't find comp 'BLOCK_01'");
}