Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions expressions for styling text like a Captcha?

  • expressions for styling text like a Captcha?

    Posted by Luke Jaeger on July 1, 2026 at 2:21 am

    hi all, I’m making a lyrics video and we want the text to be styled like a Captcha: random rotation, size variation, upper or lower case, etc, assigned per character. I’ve never used expressions with text before but I assume this can be done … has anyone tried anything like this or have suggestions?
    Thanks!

    Luke Jaeger replied 1 week, 4 days ago 2 Members · 10 Replies
  • 10 Replies
  • Dan Ebberts

    July 1, 2026 at 4:11 pm

    For random upper/lower case, you could use a Source Text expression like this:

    txt = "";
    seedRandom(index,true);
    for (i = 0; i < value.length; i++){
    txt += random(1) < .5 ? value[i].toUpperCase() : value[i].toLowerCase();
    }
    txt

    For other properties, like rotation, you can add a Rotation Animator (and set the Rotation value to say 25 degrees), add an Expression Selector, and delete the Range Selector. Then add this expression to Expression Selector’s Amount property:

    seedRandom(textIndex,true);
    random(-100,100)
  • Luke Jaeger

    July 1, 2026 at 7:52 pm

    @Dan your awesomeness knows no bounds!

    I already have this in the source text expression to do random size & baseline shift:

    posterizeTime(.5);
    textMinSize=effect("textMinSize")("Slider")
    textMaxSize=effect("textMaxSize")("Slider")
    bshift=effect("baselineShift")("Slider")
    for(let i = 0; i < value.length; i++){
    style = style
    .setFauxBold(parseInt(Math.random()), i, 1)
    .setFontSize(Math.random(textMinSize,textMaxSize), i, 1)
    .setBaselineShift(Math.random(-bshift,bshift), i, 1)
    }

    I don’t know where in that structure “setAllCaps” would go (in order to randomize the case of individual characters)

  • Dan Ebberts

    July 1, 2026 at 8:22 pm

    Just add this to the end of the style .set commands:

    .setAllCaps(Math.round(random()), i, 1)
  • Luke Jaeger

    July 2, 2026 at 12:39 am

    Dan you rule!

  • Dan Ebberts

    July 2, 2026 at 2:46 pm

    You may have figured it out already, but to make the expression selectors sync up to the randomization of your posterizeTime(), you could replace the seedRandom() statement with something like this:

    seedRandom(textIndex*1000 + Math.floor(time/2),true);
  • Luke Jaeger

    July 9, 2026 at 12:45 am

    ok here’s where we’re at so far …
    right now the text effects are time-posterized to the BPM of the song.
    which is fine, but I’d also like to try making the distortion & text animation change only when the source text changes.
    How to do that??? (ie, recalculate the distortion & other effects at every source.text keyframe).

  • Dan Ebberts

    July 9, 2026 at 4:44 pm

    Try replacing your posterizeTime() statement with this:

    seed = 1;
    if (numKeys > 0){
    seed = nearestKey(time).index;
    if (time < nearestKey(time).time) seed--;
    }
    seedRandom(seed,true);

    and if you’re using the Expression Selector expression, try replacing the seedRandom() statement with this:

    seed = 1;
    p = text.sourceText;
    if (p.numKeys > 0){
    seed = p.nearestKey(time).index;
    if (time < p.nearestKey(time).time) seed--;
    }
    seedRandom(textIndex*1000 + seed,true);
  • Luke Jaeger

    July 9, 2026 at 11:21 pm

    thanks Dan! the first one works great but the second one breaks. “Couldn’t turn result into numeric value”.
    I wasn’t doing seedRandom for the text position, I was doing this:

    myBeat=2.2166723315 ;
    posterizeTime(myBeat) ;
    wiggle(effect("wiggles / sec")("Slider"),effect("wiggle amount")("Slider"))

    Not sure how to translate that into what you suggested.

  • Dan Ebberts

    July 10, 2026 at 6:12 am

    Is this for an expression selector? If so, try this:

    p = text.sourceText;
    t = 0;
    if (p.numKeys > 0){
    n = p.nearestKey(time).index;
    if (time < p.nearestKey(time).time && (n > 1)) n--;
    t = p.key(n).time;
    }
    wiggle(effect("wiggles / sec")("Slider"),effect("wiggle amount")("Slider"),1.0,0.5,t)
  • Luke Jaeger

    July 11, 2026 at 2:49 am

    Amazing! Dan you rule.

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