Skip to main content
aurelien24
Participating Frequently
November 18, 2015
Answered

Set a value to Range Selector

  • November 18, 2015
  • 2 replies
  • 2073 views

Hi,

I am trying to set a value to a range selector by script but without success.

Here is my line of code:

- app.project.item(1).layer("Text1").property("ADBE Text Properties").property("ADBE Text Animator").property("ADBE Text Selector").property("ADBE Text Index End").setValue(3);

the error I get is "Undefiened is not an an object".

Maybe the property method doesn't work for the Range Selector.

I am rookie in script... that could explains the issue

Thanks,

Aurélien

This topic has been closed for replies.
Correct answer Paul Tuersley

Seems like you're missing a few stages. A Text Animator is inside the Text Animators group. A Range Selector is in the Text Selectors group. Each of these can be referenced by name or index (as you can have multiple animators and selectors).

app.project.item(1).layer("Text1").property("ADBE Text Properties").property("ADBE Text Animators").property(1).property("ADBE Text Selectors").property(1).property("ADBE Text Index End").setValue(3);


I recommend you google and download Jeff Almasol's 'GimmePropPaths' script. Invaluable for this kid of reference.

Paul

2 replies

UQg
Legend
November 18, 2015

In addition to what Paul said, the Index Start/End/Offset can be set only when they are revealed, which is not true by default (default settings for range selectors are "Percent")

Given the text layer L, you can do

var sel = L.text.animator(animatorId).selector(selectorId);

sel.advanced.units.setValue(2).// index

sel.property("ADBE Text Index End").setValue(3);

where animatorId/selectorId can be the name, matchName, or propertyIndex of the animator/selector.

If you specify a string (name or matchName), AE will pick the first one it finds, else the one you say.

Xavier.

aurelien24
Participating Frequently
November 18, 2015

Hi Xavier,

I also tried your method.

On this way :

L = app.project.item(1).layer("Text");

var sel = L.text.animator("MyAnim").selector("MySelector");

sel.advanced.units.setValue(2).// index

sel.property("ADBE Text Index End").setValue(3); //at this line I have the same error message "Undefiened is not an an object"

I will try to go deeper, during the evening.

Anyway thanks for your answer, and your help,

Aurélien

UQg
Legend
November 18, 2015

It took me some time to figure out: there is a missprint here: sel.advanced.units.setValue(2).// index

(the . before the // shoud be a semicolumn.)

Correct version:

L = app.project.item(1).layer("Text");

var sel = L.text.animator("MyAnim").selector("MySelector");

sel.advanced.units.setValue(2); // index

sel.property("ADBE Text Index End").setValue(3);

Xavier

Paul TuersleyCorrect answer
Inspiring
November 18, 2015

Seems like you're missing a few stages. A Text Animator is inside the Text Animators group. A Range Selector is in the Text Selectors group. Each of these can be referenced by name or index (as you can have multiple animators and selectors).

app.project.item(1).layer("Text1").property("ADBE Text Properties").property("ADBE Text Animators").property(1).property("ADBE Text Selectors").property(1).property("ADBE Text Index End").setValue(3);


I recommend you google and download Jeff Almasol's 'GimmePropPaths' script. Invaluable for this kid of reference.

Paul

aurelien24
Participating Frequently
November 18, 2015

Many thanks to you Paul. For your help and also for this very useful script!!

It may help me to less hit my head on my desk... And also help me to be more efficient.

Thanks once again

Aurélien