Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Animating first character of line

  • Dan Ebberts

    November 5, 2023 at 12:44 am

    There’s probably an easier way, but try this:

    txt = text.sourceText.value;
    s = txt.split("\r");
    tot = 0;
    val = 0;
    startIdx = 1;
    for (i = 0; i < s.length; i++){
    line = s[i];
    tot += s[i].length;
    if (textIndex <= tot && ((textIndex - startIdx) == 0)){
    val = 100;
    break;
    }
    startIdx += s[i].length;
    }
    val
  • Bill Roberts

    November 7, 2023 at 12:04 pm

    Not exactly what i needed. It selects every character, but i need it to select every first chatacter of a line when i change startIdx

  • Dan Ebberts

    November 7, 2023 at 3:21 pm

    I’m not sure why you would change startIdx, but this is what it looks like on my system:

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