Skip to main content
Participant
December 13, 2023
Question

Expressions that group different varibles for a Source Text layer.

Hi everybody, 

 

I have this expression for a source text layer, but the result didn't appear as the font style that I had set for it. 

The result is showing [object Object] instead. Just curious how to fix this issue, or is there any better way to change the font and size a section in a sentence by using expression?

 

Hope getting some advices from everybody. 

Very much appriciated!

 

All the best. 

________

 

var cardName = thisComp.layer("Card").text.sourceText;

var cardStyled = cardName.getStyleAt(0, 0).setText(cardName);

 

var groupOne = "Link your ";

var groupTwo = " today.";

 

groupOne + cardStyled + groupTwo

 

This topic is closed to new replies. Start a new post to keep the conversation going.

3 replies

Dan Ebberts
Community Expert
Community Expert
December 13, 2023

As far as I know, there's currently no way for an expression to create more than one style format in a single text layer. Once you apply an expression to source text, all characters will end up with the same style.

Translate
Participant
December 14, 2023

Thank you so much for your input, Dan Ebberts!


This one is tricky, guess we can work around it with different layer setups to get the same result. 

Translate
Dan Ebberts
Community Expert
Community Expert
December 14, 2023

That's pretty much what people do, I think. 

Translate