Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Alternative to “\r”

  • Alternative to “\r”

    Posted by Jeremy Wick on March 28, 2022 at 11:00 pm

    I’m working on a script that adds an expression to the source text which includes several instances of “\r”. Unfortunately, this causes a line break in the expression code itself (omitting the actual “\r”).

    Is there an alternative way to write “\r”? (similar to “&” in html)

    Dan Ebberts replied 4 years, 1 month ago 2 Members · 1 Reply
  • 1 Reply
  • Dan Ebberts

    March 28, 2022 at 11:32 pm

    I think you just have to double escape it with a double back slash:

    var myProp = app.project.activeItem.layer(1).property("Text").property("Source Text");

    var myExpr = '"This is a\\rmulti-line test."';

    myProp.expression = myExpr;

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