Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions “Source Text” expression – Ignore first word of source text

  • “Source Text” expression – Ignore first word of source text

    Posted by Dario De angelis on October 8, 2017 at 1:40 pm

    Hi, guys
    i was wondering if there is one expression that allow me to ignore the first world from a source text. I try to explain:

    I’m working on a lower third for my youtube channel;
    So now, I have 2 lower third version; one with NAME and SURNAME and the other only with surname;
    I would like to control both of this lower third with only 1 MAIN TEXT CONTROL, and if for the first one is not a problem to link the “SOURCE TEXT” with the TEXT CONTROL, for the second one i’ve some problem to create an expression that simply ignore the first word (the name) of my TEXT CONTROL’s source text and show me only the rest of the text.

    Some of you can help me?

    Dario De angelis replied 8 years, 7 months ago 2 Members · 4 Replies
  • 4 Replies
  • Dario De angelis

    October 8, 2017 at 2:15 pm
  • Dan Ebberts

    October 8, 2017 at 2:18 pm

    Maybe this for Source Text:


    try{
    value.split(" ")[1];
    }catch(e){
    value;
    }

    Dan

  • Dario De angelis

    October 8, 2017 at 2:35 pm

    Thank you Dan;

    For now it works better to add

    .split(" ")[1]

    at the end of my text; so the final expression is:
    comp("TEXT").layer("MAIN TEXT CONTROL").text.sourceText.toUpperCase().split(" ")[1]

    that for the example MAIN TEXT: “LeBron James” gave me only “James” as result

    but now, I have problem with the surname that has more than 1 words as example: “Micheal De Vito”; with this kind of surname the expression gave me only “De” as result but I need to show the full surname “De Vito”. How can i fix it?

  • Dario De angelis

    October 8, 2017 at 3:09 pm

    Found it!


    text_array1 = comp("TEXTS").layer("MAIN TEXT CONTROL").text.sourceText.toUpperCase().split(" ");
    try
    {
    text_array1[1]+" "+ text_array1[2];
    }
    catch(e) {
    text_array1[1];
    }

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