Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
1

How to change the value of text fields in layers

Community Beginner ,
May 01, 2024 May 01, 2024

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

TOPICS
Expressions , How to , Scripting
325
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 01, 2024 May 01, 2024

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.

 

Mathias Möhl - Developer of tools like BeatEdit and Automation Blocks for Premiere Pro and After Effects
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 01, 2024 May 01, 2024
LATEST

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'");
}
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines