Copy link to clipboard
Copied
I am using a drop down menu to change a line of text but, I can't alter the styling of the text without altering the entire line. I only need to change one or two words of the line with my drop down so is there a way to make it only change the words in a selected range?
I normally just have multiple versions of the text layer and use the drop down to toggle their opacity but I'd like to get this on one layer if possible.
Thanks
The get Functions allows you to obtain the text style from any character; not just the first character. The getStyle function allows for two arguments, index and atTime.
text.sourceText.getStyleAt(index, atTime);
More info here -
https://helpx.adobe.com/after-effects/using/expressions-text-properties.html
The main limitation is with being able to have only one textStyle per Text Layer when working with Text Layer Style Expressions.
HTH
Copy link to clipboard
Copied
Long and short: No. This is a known issue/ limitation of text style expressions. As soon as you change the source text with an expression, the source formatting is lost and only the style of the first letter is used. Stick with splitting layers.
Mylenium
Copy link to clipboard
Copied
That's a shame, thanks anyway
Copy link to clipboard
Copied
The get Functions allows you to obtain the text style from any character; not just the first character. The getStyle function allows for two arguments, index and atTime.
text.sourceText.getStyleAt(index, atTime);
More info here -
https://helpx.adobe.com/after-effects/using/expressions-text-properties.html
The main limitation is with being able to have only one textStyle per Text Layer when working with Text Layer Style Expressions.
HTH
Copy link to clipboard
Copied
Could you use a Text Animator's Range option with an expression based on the dropdown value?
The value of the dropdown menu returns from 1 onwards, but the range value counts the first word as 0. In the range start expression, you just need to pickwhip the dropdown value, then add -1
The End value is just +1 of the start, with the Advanced settings using the index and words as options.