ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

AE Script : Link Text.Source to Checkbox

COW Forums : Adobe After Effects

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Jonathon Lau
AE Script : Link Text.Source to Checkbox
on May 19, 2015 at 1:56:13 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.


Return to posts index

Darby Edelen
Re: AE Script : Link Text.Source to Checkbox
on May 19, 2015 at 9:29:43 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


Return to posts index

Jonathon Lau
Re: AE Script : Link Text.Source to Checkbox
on May 26, 2015 at 1:45:15 am

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


Return to posts index


Walter Soyka
Re: AE Script : Link Text.Source to Checkbox
on May 19, 2015 at 10:32:14 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?

http://www.keenlive.com/renderbreak/2014/06/rigging-ae-comps-with-the-new-t...

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 [twitter]   |   RenderBreak [blog]   |   Profile [LinkedIn]


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]