Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions using an expression selector to select just certain charactor values?

  • using an expression selector to select just certain charactor values?

    Posted by Adam Smith on January 16, 2013 at 5:11 am

    Would it be possible to select certain character values using an expression selector?

    The reason I want to do this is the particular font that I have to use has a numeral “1” with a little more space after it than the client would like. Normally I would just kern it by hand, but I have a counter where the value is animated by an expression. Therefore I cannot set tracking values on a per character basis without an expression.

    I would like to do something like the following, but I don’t know the correct syntax.

    for(var i=0;i<textTotal;++1)
    {
    if(textIndex[i] == "1") value; else 0;
    }

    Dan Ebberts replied 13 years, 4 months ago 2 Members · 3 Replies
  • 3 Replies
  • Dan Ebberts

    January 16, 2013 at 5:48 am

    After you add the tracking animator, add an expression selector, delete the range selector, and set the tracking value that you want for the “1” characters, you would add an expression like this to the Amount property:

    if (text.sourceText[textIndex-1] == “1”)100 else 0

    Dan

  • Adam Smith

    January 16, 2013 at 6:24 am

    Thanks Dan! Just what the doctor ordered. I just made a small donation on your website to go a small way to thanking you for all of the help you’ve provided over the years.

  • Dan Ebberts

    January 16, 2013 at 6:29 am

    Glad I could help. Thanks for the tip – I appreciate it!

    Dan

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