Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Script to change animator settings

  • Script to change animator settings

    Posted by Joana Bow on June 30, 2023 at 3:14 pm

    Hey!! I’m trying to create a script the adds text layers, until now is running okay and adds text layers but now I want to add animators to those text layers and that’s where it gets stuck. It adds the animator but I’m trying to reach the advanced tab more specifically the mode tab to change it to subtract but is not working.

    this is the code I’ve:

     

    var Animator1 = layer.Text.Animators.addProperty(“ADBE Text Animator”);

    var A1opacity = Animator1.property(“ADBE Text Animator Properties”).addProperty(“ADBE Text Opacity”);

    var A1Selector = Animator1.property(“ADBE Text Selectors”).addProperty(“ADBE Text Selector”)

    var EndA1 = A1Selector.property(“ADBE Text Percent Start”);

    var ModeA1 = A1Selector.property(“ADBE Text Range Advanced”).property(“ADBE Text Selector Mode”).subtract;

    EndA1.setValue(36);

     

    Does anyone know how to set a value that is not a number because I can access the numerical ones just not any of the ones with actual names like ‘based on’, ‘units’ and ‘modes’?

    Thanks in advance for all the help 🙂

    Brie Clayton replied 3 years ago 3 Members · 3 Replies
  • 3 Replies
  • Walter Soyka

    June 30, 2023 at 8:36 pm

    Dropdowns in Ae use index numbers to represent values. For the Text Selector Mode, the first item, Add, is 1. The second item, Subtract, is 2, etc.

    Here’s the code snippet you’d want, with comments on two lines explaining the changes:

    var Animator1 = layer.Text.Animators.addProperty("ADBE Text Animator");

    var A1opacity = Animator1.property("ADBE Text Animator Properties").addProperty("ADBE Text Opacity");

    var A1Selector = Animator1.property("ADBE Text Selectors").addProperty("ADBE Text Selector")

    var EndA1 = A1Selector.property("ADBE Text Percent Start");

    var ModeA1 = A1Selector.property("ADBE Text Range Advanced").property("ADBE Text Selector Mode"); // no "subtract" here, just get the object

    ModeA1.setValue(2); // set the Text Selector Mode to the second item in the list, "Subtract"

    EndA1.setValue(36);

  • Joana Bow

    July 1, 2023 at 4:29 pm

    Thanks so much for that!! It worked perfectly!

  • Brie Clayton

    July 2, 2023 at 1:18 am

    Thank you for the solve, Walter!

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy