[expressions to change value and style of text] - PLEASE HELP
  • Hi everyone,

    I am currently trying to find an expression that will allow me to change the font style and font size using square brackets. We have a platform that works as a bridge between a user and After Effects, so any text input is being completed through the API so the manual adjustment of specific characters or words is not available.

    I have the above expression for changing a colour but cannot seem to find one to change both the font style and font size. Please see the colour expression below. This makes sense because I can then choose RGB FILL as an additional property to instruct AE to change the properties of text within square brackets.

    SOURCE TEXT EXPRESSION:

    str = text.sourceText;res1 = str.split("[").join("\u200b");res2 = res1.split("]").join("\u200b");

    FILL RGB ANIMATOR EXPRESSION:

    Start Expression:
    txt = text.sourceText;zws = "\u200b";
    function getPosition(string, subString, index) {  return string.split(subString, index).join(subString).length;}
    val = getPosition(txt, '\u200b', 1)

    Stop Expression:
    txt = text.sourceText;zws = "\u200b";
    function getPosition(string, subString, index) {  return string.split(subString, index).join(subString).length;}
    val = getPosition(txt, '\u200b', 2)





This discussion has been closed.
All Discussions