Edit 2
Jul 10, 2021
It’s been a while but I’ve just stumbled upon this little video that actually explains a very simple way to just expression link layers together to copy their style. Haven’t tried it so I’m not sure how many styles are actually supported but thought I’d link it here because it’s relevant to the topic: https://youtu.be/5hTVqDleABU
Edit 1
Sooo, this turned into a larger R&D session about text layers than I had expected. It seems that the JavaScript API's access to text layer's properties has some limitations as well. I spent some time reading the docs once more and testing every property and made a simple overview of what won't sync so You won't get unpleasantly surprised:
It makes sense that some settings - like kerning, which is a per-character setting - can't be modified as simply as say the font. Others like the Stroke/Fill rules seem more like a bug in the API than a sensible restriction (I hope that some guy from Adobe will see my post on the After Effects Scripting forum and give some feedback/insight). For now I can't do much more about the limitations mentioned. Of course the script might still be helpful in some cases despite the limitations.
All test results were acquired through After Effects CC2015 (13.5.0.347), information from the After-Effects-CS6-Scripting-Guide.pdf and a bunch of web searches.
In case anyone wants to try and fiddle with it themselves, here's how to modify a text layer's properties via JavaScript:
// Get text layer's Source Text property
var prp = app.project.activeItem.layer(1).property("Source Text")
// Assign to text layer to be able to edit properties
prp.setValue(new TextDocument(prp.value.text))
var doc = prp.value
// Make some changes to the TextDocument
doc.text = "Something"
doc.font = "Verdana"
if(doc.applyFill){
doc.fillColor = [0.1,0.5,1]
}
// Assign the modified TextDocument to the text layer
prp.setValue(doc)
And here's an overview of the properties available to the JavaScript API on a text layer's
Source Text
property and which values to get/set:Property
Access
Value type
Value example/Description
read/write
integer
left=7213, right=7214, center=7215 + if boxText == true :: last left=7216, last centered=7218, last right=7217, all=7219
read/write
boolean
true/false (only works for "Fill Over Stroke" and "Stroke Over Fill")
Initial Post
A graphics artist colleague of mine, had a request about syncing After Effects text layers' attributes (font, font size etc.) via expressions. Unfortunately at the time of writing this You can only link the contents of the text, but not its attributes. So I made the next best thing: A small script that does it at the push of a button: