Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Combining text.sourceText.split with SourceRectAtTime

  • Combining text.sourceText.split with SourceRectAtTime

    Posted by Niels b Nielsen on December 5, 2017 at 11:12 pm

    I’m working on a Premiere live text template with dynamic links to After Effects graphics. I’m using text.sourceText.split expression in a text animator to highlight certain words. I would like the highlighted words to be in a box. Is it possible to somehow combine the text.sourceText.split expression with a SourceRectAtTime expression for only the selected words?

    The text.sourceText.split expression used is:

    highlight = thisComp.layer(“[HIGHLIGHT WORDS]”).text.sourceText.split(“+”);

    result = 100;

    for (i = 0; i < highlight.length; i++){

    if (textIndex == parseInt(highlight[i],10)){

    result = 0;

    break;

    }

    }

    result

    This is great for coloring words, but can I somehow make these words appear in a box? I’ve tried creating a boxed font variant and put this in a layer below, but I guess theres a better/simpler way to achieve this?

    Kalleheikki Kannisto replied 8 years, 7 months ago 2 Members · 1 Reply
  • 1 Reply
  • Kalleheikki Kannisto

    December 17, 2017 at 3:04 pm

    If it is always one continuous range that you want to highlight, you might want to break the text onto three layers (in most cases the word to be marked would be in middle of the string), then you can use sourcerect to move the layers in the right locations one after the other and then draw a box around the middle box.

    Also, there will be situations where the word(s) are in the first or last rectangle, so some IF statements are needed to draw around the first or last box. In which case you would really be using just two of the layers.

    Kalleheikki Kannisto
    Senior Graphic Designer

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