Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Sample text formatting with expression?

  • Sample text formatting with expression?

    Posted by Phil Aupperle on September 25, 2015 at 6:38 pm

    Is there a way to sample the formatting of a block of source text with an expression? I’m using sourceText to make multiple instances of information for a lower third. I don’t want to precomp anything if possible to avoid rasterization and because it gets out of hand when versions are duplicated many times, but I still need to generate multiple identical text layers from a single source text layer. I’d love to be able to adjust bold, italics, text color, font, etc. one time in the source layer and be able to reuse it several times within the same comp. Doable? I haven’t been able to find any solutions on the Internets…

    If I have to concatenate several source layers, that’s fine; I just need to force carriage returns at certain points.



    thisComp.layer("Source Text 1 ").text.sourceText + " " + thisComp.layer("Source Text 2").text.sourceText + " " + thisComp.layer("Source Text 3").text.sourceText

    Filip Vandueren replied 3 years, 5 months ago 4 Members · 6 Replies
  • 6 Replies
  • Dan Ebberts

    September 25, 2015 at 6:55 pm

    Expressions don’t have access to text formatting info.

    You could precomp with continuous rasterization turned on (to solve scaling issues).

  • Phil Aupperle

    September 25, 2015 at 7:18 pm

    That’s what I thought. Another reason I don’t want to precomp is so I can redesign it and have it cascade through the whole hierarchy with out having to use True Comp Duplicator or something to make and replace a zillion nested comps.

    I don’t have the time to mess with it right now, but I think one way to do it might be to have several text layers stuck together with anchor points that are attached to the end of the previous text layer. It would probably be pretty janky, but I imagine with a free day one could sort it out…

  • Dan Ebberts

    September 25, 2015 at 8:12 pm

    >Another reason I don’t want to precomp is so I can redesign it and have it cascade through the whole hierarchy…

    It would, wouldn’t it? If there’s only one version of the precomp in the project bin, every instance where it’s used as a layer in another comp will match the original. Or are you duplicating it in the project bin because each copy is unique in some way?


  • Phil Aupperle

    September 25, 2015 at 8:27 pm

    Well, there would have to be a unique chain of precomps for each lower third. What I’d like to achieve is a single comp that I can just change the text with formatting and not have to duplicate and replace a bunch of nested comps. In this instance, I’m trying to make a lower third that can be either left or right justified, generate the backplate sizes with an expression based on the text length, and have the option of mixing fonts and bolding certain words. The whole thing is hooked up to a spreadsheet with the Templater script. I had wanted to just make a comp that had several controller layers that would make everything else happen, but if I get into precomps I’ll have to generate that whole hierarchy for each version, and updates will put me back to square one.

    If there were a way to grab the text parameters, it would be dead simple. Thanks for the suggestions though.

  • Dariusza Santana

    July 8, 2020 at 5:28 pm

    Hi, can you do this?
    I need to italic each word in .mogrt files. But when I put .mogrt in Premiere, the whole text is in italics, it’s not a selected word.

  • Filip Vandueren

    July 8, 2020 at 7:46 pm

    Scripting has changed, you can now get the style from the text. But you can only set the style for the whole textlayer.
    Bolds and italics can be faked a bit with expression selectors affecting stroke thickness and slant, there are a few posts in the forum on how to do that, including a crude HTML parser-like roof of concept I Wrote a few weeks ago:

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