Skip to main content
zachneel
Participating Frequently
March 9, 2019
Answered

How to add an expression to the start, and end properties of a text animator range selector?

  • March 9, 2019
  • 1 reply
  • 1384 views

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;

This topic has been closed for replies.
Correct answer Dan Ebberts

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

1 reply

Dan Ebberts
Community Expert
Dan EbbertsCommunity ExpertCorrect answer
Community Expert
March 9, 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 Index End").expression = endExpression;

Dan

zachneel
zachneelAuthor
Participating Frequently
March 9, 2019

Worked perfect. Thanks mate.