Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Creating expression via Extendscript

  • Creating expression via Extendscript

    Posted by Chris Voelz on October 11, 2022 at 6:24 pm

    I am having an issue creating an expression via a script. I’m creating a multi-line expression that is being added to Source Text. I am using \r to add returns to my expression so it is easy to read the expression and manipulate it further in After Effects. My issue is that part of my expression has a line where I am combining variables and adding carriage returns so the text is on multiple lines. When the line gets created it is adding carriage returns to the expression and breaking the expression. How can I pass “\r” as part of the code for After Effects to read as the expression?

    This is how I am adding the expression

    app.project.item(2).layer(1).property("Source Text").expression =
    'normCopy = line1 +"\r"+ line2 + "\r" + line3;\r'

    This is how it shows up in After Effects

    normCopy = line1 +"

    "+ line2 + "

    " + line3;

    Chris Voelz replied 3 years, 10 months ago 1 Member · 1 Reply
  • 1 Reply
  • Chris Voelz

    October 11, 2022 at 6:59 pm

    I wasn’t escaping it properly…

    “\\r” works.

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