Copy link to clipboard
Copied
Hi,
This seems basic, but I can't figure it out. I can't change the value of my text Master Property, via Extendscript. I tried treating the property the same way I would treat the Source Text property of a text layer, but After Effects doesn't like this.
var newText = new TextDocument("This is new text.");
var myLayer = myComp.layer("Title Text"); //This is my comp with the master properties.
var myLayer2 = myComp.layer("Text 1"); //This is my text layer.
var myProp = myLayer.masterProperty("Text");
var myProp2 = myLayer2.sourceText;
myProp2.setValue(newText); //This is changing the text of the text layer and works.
myProp.setValue(newText); //This is changing the text of the master property and doesn't work.
The error I get in Extendscript is "After Effects error: invalid text layer."
I would appreciate any help.
It looks like there's a bug with text properties! I can't get or set values with text properties, but with all other property types it works just fine.
I've filed a bug about this (DVAAE-4208260).
Copy link to clipboard
Copied
It looks like there's a bug with text properties! I can't get or set values with text properties, but with all other property types it works just fine.
I've filed a bug about this (DVAAE-4208260).
Copy link to clipboard
Copied
Thanks for confirming that it's a bug. Hopefully it gets fixed.
For anyone else, I worked around it by adding an expression to the Text master property linking it to the layer name, then changing the layer name. That seems to work ok.
myLayer.masterProperty("Text").expression = "thisLayer.name";
myLayer.name = str;
Copy link to clipboard
Copied
Hey Z, I'm stuck on this - have you heard of or discovered a solution? Anything better than the workaround below?
Copy link to clipboard
Copied
I mean above!