• 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 add an expression to the start, and end properties of a text animator range selector?

Explorer ,
Mar 08, 2019 Mar 08, 2019

Copy link to clipboard

Copied

So I have a code trying to add an expression to these properties, but the error comes back saying they are hidden?

Any help is appreciated, here's my code currently:

var animator = app.project.activeItem.selectedLayers[0].Text.Animators.addProperty("ADBE Text Animator");

var selector = animator.property("ADBE Text Selectors").addProperty("ADBE Text Selector");

selector.advanced.units.setValue(2);

var startExpression=("0");

var endExpression=("10");

selector.start.expression=startExpression

selector.end.expression=endExpression;

TOPICS
Scripting

Views

1.1K

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

Community Expert , Mar 08, 2019 Mar 08, 2019

When you set the units to Index, it changes the names of the Start and End parameters. This should work:

var animator = app.project.activeItem.selectedLayers[0].Text.Animators.addProperty("ADBE Text Animator"); 

var selector = animator.property("ADBE Text Selectors").addProperty("ADBE Text Selector"); 

selector.advanced.units.setValue(2); 

var startExpression=("0"); 

var endExpression=("10"); 

selector.property("ADBE Text Index Start").expression = startExpression;

selector.property("ADBE Text Ind

...

Votes

Translate

Translate
Community Expert ,
Mar 08, 2019 Mar 08, 2019

Copy link to clipboard

Copied

When you set the units to Index, it changes the names of the Start and End parameters. This should work:

var animator = app.project.activeItem.selectedLayers[0].Text.Animators.addProperty("ADBE Text Animator"); 

var selector = animator.property("ADBE Text Selectors").addProperty("ADBE Text Selector"); 

selector.advanced.units.setValue(2); 

var startExpression=("0"); 

var endExpression=("10"); 

selector.property("ADBE Text Index Start").expression = startExpression;

selector.property("ADBE Text Index End").expression = endExpression;

Dan

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
Explorer ,
Mar 09, 2019 Mar 09, 2019

Copy link to clipboard

Copied

Worked perfect. Thanks mate.

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 10, 2023 Nov 10, 2023

Copy link to clipboard

Copied

can i know where we shoud type this exprition to work !? 

 

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
Community Expert ,
Nov 10, 2023 Nov 10, 2023

Copy link to clipboard

Copied

LATEST

It's a script, not an expression. You would save it (from a plain text editor) as a .jsx file then File > Scripts > Run Script File and navigate to the file.

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