Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Typewriter , remove text using expression substr

  • Typewriter , remove text using expression substr

    Posted by Peter Sparks on April 6, 2019 at 9:44 pm

    HI Guys

    I am new to AE, and the expressions and cannot work out the formula to reduce the text after its been written out.
    In effect I am trying to produce a few statements which get typed out, then untyped and then another on another layer would be typed.

    I have the expression from the net which types out the words the first time, but how to do this in reverse after say 1/2 seconds of completing the string?

    Thank you for any help.

    F = Math.round(time*effect("Blink Speed")("Slider") % 1);
    L = X.length;
    T = time*effect("Speed")("Slider") - effect("Start At")("Slider")*effect("Speed")("Slider");

    Cursor = " ";
    if (F==1 | T>0) Cursor = "|";
    if(F==1 |(T0)){Cursor="|";}else{Cursor=" ";}

    if (T>0 ) X.substr(0,T) + Cursor
    else Cursor

    Kalleheikki Kannisto replied 7 years, 5 months ago 2 Members · 6 Replies
  • 6 Replies
  • Kalleheikki Kannisto

    April 7, 2019 at 6:43 pm

    It seem likely you could achieve it with the existing expression by changing (keyframing) the start time and speed so that it would work in reverse. Meaning the speed would be negative and the start time would change to account for completing the write-in part first. It’s too late at night for me to figure out what the start time would have to be to do that, but you should be able to figure that out by experimenting.

    Kalleheikki Kannisto
    Senior Graphic Designer

  • Peter Sparks

    April 8, 2019 at 10:03 am

    Thank you for your thoughts, I am not sure I follow completly if I am honest, but I will keep going and see if I cam can get it working.

    I was experimenting with trying to work out if the text was fully written ( at full length) and not only in part, then to reduce the substr count over a growowing time which will achieve the un typing effect. No joy as of yet…

  • Kalleheikki Kannisto

    April 8, 2019 at 2:10 pm

    Worked just fine.

    Example:
    Text: “Typing some text here are we?”
    Hold keyframe at 0: Speed 10, Blink Speed 1, Start at 2
    Hold keyframes at 10 sec: Speed -10, Start at 14

    Kalleheikki Kannisto
    Senior Graphic Designer

  • Peter Sparks

    April 8, 2019 at 2:11 pm

    Sorry how do i put this into the expression?
    Thank you again for your help .

  • Kalleheikki Kannisto

    April 8, 2019 at 2:12 pm

    Did have to fix two lines in the expression though.

    X = text.sourceText;//<<<<Added this line
    F = Math.round(time*effect("Blink Speed")("Slider") % 1);
    L = X.length;
    T = time*effect("Speed")("Slider") - effect("Start At")("Slider")*effect("Speed")("Slider");

    Cursor = " ";
    if (F==1 | T>0) Cursor = "|";
    if(F==1 |(T==0){Cursor="|";}else{Cursor=" ";}//<<<< T==0

    if (T>0 ) X.substr(0,T) + Cursor
    else Cursor

    Kalleheikki Kannisto
    Senior Graphic Designer

  • Kalleheikki Kannisto

    April 8, 2019 at 2:15 pm

    You don’t put that in the expression, you keyframe the sliders.

    Kalleheikki Kannisto
    Senior Graphic Designer

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