Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions What expression would I research to do this?

  • What expression would I research to do this?

    Posted by Erin Shelby on August 30, 2005 at 9:22 pm

    Hi, I’m trying to grab a specific line from a list of text using expressions. So layer 1 is doing the grabbing, but layer 2 has a list that is like:

    dog
    cat
    bat

    … do I have to use the ‘split’ javascript?

    Dan Ebberts replied 20 years, 8 months ago 2 Members · 4 Replies
  • 4 Replies
  • Dan Ebberts

    August 30, 2005 at 10:06 pm

    Yup, split is what you want. Assuming your words are separated by carriage returns, you could use something like this to pick out the word “cat” from your example:

    s = thisComp.layer(“layer 2”).text.sourceText.split(String.fromCharCode(13));
    s[1]

    Dan

  • Erin Shelby

    August 30, 2005 at 10:33 pm

    awwwwwsommmmmeeeeee1!!!11!!!

  • Erin Shelby

    August 30, 2005 at 11:03 pm

    Hey, thanks for the help Dan! Do you know if you could direct me to a reference for javascript/expression ‘commands’ like split? Are there commands that can effect kerning/typeface/ect? Thanks again!

  • Dan Ebberts

    August 30, 2005 at 11:26 pm

    Any good JavaScript reference will do, you just have to ignore the stuff that’s specific to web pages. I like “JavaScript the Definitive Guide” by David Flanagan.

    Unfortunately you can’t control kerning or font selection from an expression. You can control tracking, line spacing, scale, and fill & stroke color though.

    Dan

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