Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Cursor for Type On Effect

  • Cursor for Type On Effect

    Posted by Aaron Williams on April 27, 2022 at 3:40 pm

    It sounds simple but I’m having a hard time getting this to work right. I just want a non-blinking cursor to wright on text, often in multiple lines. Then the option of the cursor to erase it all again. I have gotten real close using a few methods. This one I think give the most flexibility for what I want to do.

    The problems are with line breaks in paragraph boxes: The text will start typing on the first line until in runs out of room then jumps the current word to the second line and finishes typing. I could manually add a line break, but it then breaks the cursor because line breaks must count as a character and throws the whole thing off.

    I’m not that hip on the programing. I took a blinking cursor script and changed it enough to replace the empty space with the same character. Don’t make fun of me too bad 😉

    Source Text

    var sign = "|";

    var blinkInterval = 15;

    var i = effect("Text")("ADBE Slider Control-0001");

    var on = effect("On/Off")("ADBE Checkbox Control-0001");

    var frames = timeToFrames(time);

    var check = frames / blinkInterval;

    if (on == 1) {

    if (i.valueAtTime(time + thisComp.frameDuration) > i){

    end = sign;

    } else {

    if (Math.floor(check) % 2 == 0) {

    end = sign;

    } else {

    end = "|";

    }

    }

    } else {

    end = " ";

    }

    text.sourceText.substr(0,parseInt(i)) + end;

    Range Selector 1 > Start

    text.animator("ADBE Text Animator")("ADBE Text Selectors")("ADBE Text Selector")("ADBE Text Index End") - 1;

    Range Selector 1 > End

    text("ADBE Text Document").length;

    In the Effects there is the Slider, Checkbox, and Color picker.

    Any help would be great. Thank you!

    AARON

    Aaron Williams replied 4 years ago 1 Member · 0 Replies
  • 0 Replies

Sorry, there were no replies found.

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