Skip to main content
zachneel
Participating Frequently
Mar 9, 2019 4:18 AM UTC
Answered

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

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 is closed to new replies. Start a new post to keep the conversation going.
Dan Ebberts
Dan EbbertsCorrect answer
Community Expert
Mar 9, 2019 7:48 AM UTC

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

4 replies

Dan Ebberts
Community Expert
Dan EbbertsCommunity ExpertCorrect answer
Community Expert
Mar 9, 2019 7:48 AM UTC

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

Translate
zachneel
zachneelAuthor
Participating Frequently
Mar 9, 2019 8:58 AM UTC

Worked perfect. Thanks mate.

Translate