Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Forums Adobe After Effects Expressions Extracting data from text layer (non-numeric)

  • Extracting data from text layer (non-numeric)

  • Oscar Nyquist

    June 3, 2021 at 8:59 am


    I have a dropdown menu that is supposed to react to data in a text layer. I can’t get it to work using a simple parseInt, and from what I can gather, that only works with numerical values(?).

    Is there some other way to do this? Here is my expression so far:

    var y = text.sourceText;
    var x = parseInt(y);
    if (x == “JP_ja”) {
    } else {

    Thanks in advance!

  • Dan Ebberts

    June 3, 2021 at 1:38 pm

    You wouldn’t need parseInt() if you’re just comparing text. This should work:

    txt = text.sourceText;

    txt == "JP_ja" ? 2 : 1

  • Oscar Nyquist

    June 4, 2021 at 1:18 pm

    Yep, the solution was of course too simple for me to figure out on my own. Thanks a lot!

Viewing 1 - 3 of 3 posts

Log in to reply.

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