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

How to edit a text Master Property via ExtendScript?

New Here ,
Nov 08, 2018 Nov 08, 2018

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.

TOPICS
Scripting

Views

1.0K

Translate

Translate

Report

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

correct answers 1 Correct answer

Contributor , Nov 12, 2018 Nov 12, 2018

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).

Votes

Translate

Translate
Contributor ,
Nov 12, 2018 Nov 12, 2018

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).

Votes

Translate

Translate

Report

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
New Here ,
Nov 12, 2018 Nov 12, 2018

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;

Votes

Translate

Translate

Report

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
New Here ,
Oct 05, 2023 Oct 05, 2023

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?

Votes

Translate

Translate

Report

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
New Here ,
Oct 05, 2023 Oct 05, 2023

Copy link to clipboard

Copied

LATEST

I mean above!

Votes

Translate

Translate

Report

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