Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects AE Script : Link Text.Source to Checkbox

  • AE Script : Link Text.Source to Checkbox

    Posted by Jon Law on May 19, 2015 at 1:56 am

    Hey there,
    I am making AE templates for a broadcaster which editors in Premiere can change quickly.

    As Premiere allows users to adjust AE text layers via dynamic link, I was going to control my expressions via Text.Source inputs.

    Sound idea, but I can’t do it.

    Question: How do you link a text source to turning on and off different checkboxes?

    if the text is 1, Checkbox A will turn on
    if Text is 2, Checkbox B will turn on
    if Text is 3, Checkbox C will turn on
    etc

    I would really appreciate any help.

    Thank you.

    Jon Law replied 11 years, 3 months ago 3 Members · 3 Replies
  • 3 Replies
  • Darby Edelen

    May 19, 2015 at 9:29 am

    The way you’ve described this it sounds like you want the text source to control a checkbox? I’d expect things to go the other way around generally.

    At any rate, you’d need to check the value of the source text on each checkbox:

    (thisComp.layer("MyText").source Text == "Hello!")

    This should enable the checkbox if the MyText source text is Hello! Of course if the user enters hello? it wouldn’t match.

    I haven’t checked the above code, there may be a small piece missing.

    Darby Edelen

  • Walter Soyka

    May 19, 2015 at 10:32 am

    [Jonathon Lau] “As Premiere allows users to adjust AE text layers via dynamic link, I was going to control my expressions via Text.Source inputs. Sound idea, but I can’t do it.”

    Have you seen my demo for this technique?

    https://www.keenlive.com/renderbreak/2014/06/rigging-ae-comps-with-the-new-templates-feature/

    I like to make it easier on the editor: I convert everything to lowercase for my testing, and check to see if the string contains the word I’m looking for rather than is strictly equal to it.

    // get layer input and make it all lower case for easier testing
    input = thisLayer.text.sourceText.toLowerCase();

    // test to see if input contains "word"
    if (input.indexOf("word") != -1) {
    // what to do if "word" is found
    } else {
    // what to do if "word" is not found
    }

    (Also, this is an expression, not a script. Expressions are code that evaluate in the project as it is rendered and return a value into a property; scripts run outside of the render and can have manipulate the entire project.)

    Walter Soyka
    Designer & Mad Scientist at Keen Live [link]
    Motion Graphics, Widescreen Events, Presentation Design, and Consulting
    @keenlive   |   RenderBreak [blog]   |   Profile [LinkedIn]

  • Jon Law

    May 26, 2015 at 1:45 am

    Thanks for taking time to type that up. Helped me a lot!!

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