Forum Replies Created

  • Yannick Michel

    March 3, 2023 at 12:36 pm in reply to: Text highlight (expression selector)

    Hi Filip and Yoan,
    I was looking through your thread because I need something quite similar to what you have done but a little different. Let me explain: I need to create a .mogrt for my colleagues where they can highlight multiple words in a text. And the idea is to have a text input where they write their text and another text input where they write the words they want to highlight. Here you can see that I succeed to highlight one word, but I can’t figure out how to highlight multiple words.
    here is the expression I use to highlight one word:

    txt=thisComp.layer(“Highlight”).text.sourceText;

    words = txt.split(/\s/);

    RE = new RegExp(words,”g”);

    hl=text.sourceText.replace(RE, function($0) {

    return ‘~’.repeat($0.length);

    });

    if(hl.charAt(textIndex-1) == ‘~’) { 100 } else { 0 };

    I found some code on workbench youtube channel. I know I need a loop

    for (i=0, i<words.length, i++){}
    But since I am still no master in expression, I don’t know how to write it down. So if one of you hase the answer, it would be great.

    Thank you

  • Thank you for your quick reply.
    I haven’t found the livefont fogwriter. But I used a smoke emitter put a short life to the particle, add some gaussian blur and reveal my text with masks. It isn’t exactly what I wanted, but It should be ok.

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