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

Add Range Selector in Text by Script

Community Beginner ,
Feb 04, 2025 Feb 04, 2025

Good day.
Please tell me, I'm trying to write a script that will create a text layer and add a color animator there, so that I can change the color in certain words from a sentence, but every time I do this, I get a null error in the line of code where rangeSelector is used.

valera_9213_0-1738695039149.pngexpand imagevalera_9213_1-1738695049312.pngexpand imagevalera_9213_2-1738695051331.pngexpand imagevalera_9213_3-1738695055784.pngexpand image

 

 

TOPICS
Expressions , Scripting
214
Translate
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
Adobe Employee ,
Feb 04, 2025 Feb 04, 2025

Hello @valera_9213,

Thanks for the message. Since I'm not a scripting expert, is it possible to share the specific line of code where the error occurs, and I’ll share it with the devs. I hope it will help. Sorry for the frustration.

 

Cheers,
Kevin

 

Kevin Monahan - Sr. Community & Engagement Strategist – Pro Video and Audio
Translate
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 ,
Feb 04, 2025 Feb 04, 2025

I think your "ADBE Text Selector Start" should be "ADBE Text Percent Start". That goes for the End parameter as well.

Translate
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 Beginner ,
Feb 05, 2025 Feb 05, 2025

Yes, you are absolutely right. I wrote it incorrectly. Moreover, I need to manage it using indexes.
Despite the fact that I tried ADBE Text Persent Start and
ADBE Text index Start, it did not give me a result and returned null.
Using alert(rangeSelector.property(4).isModified); I found out that the properties are hidden and I do not know how to work with them.

Here is an example of my code.

var animator = textLayer.property("ADBE Text Properties").property("ADBE Text Animators").addProperty("ADBE Text Animator");
    var rangeSelector = animator.property("ADBE Text Selectors").addProperty("ADBE Text Selector");
    var fillColor = animator.property("ADBE Text Animator Properties").addProperty("ADBE Text Fill Color");
    fillColor.setValue([1, 0, 0]);

rangeSelector.property(4).setValueAtTime(1, 6); 
rangeSelector.property(5).setValueAtTime(1, 12);
Translate
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 Beginner ,
Feb 05, 2025 Feb 05, 2025
LATEST

I also wanted to ask if there is any documentation on how to work with these or those parameters. Since my only source at the moment is GPT and it is not very reliable.

Translate
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