Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Layer Position Relative to Text Length

  • Dan Ebberts

    June 7, 2018 at 10:52 pm

    That would be a Position expression for a layer that you want to line up to the right of the text layer.


  • Andrew Musselman

    June 8, 2018 at 2:49 am

    Awesome!!! And what if I wanted to use it for text on the left side of the layer?

    Never Stop Learning.

  • Kalleheikki Kannisto

    June 10, 2018 at 6:33 am

    Although I didn’t read that very carefully, I expect it should work by changing the last line to


    Kalleheikki Kannisto
    Senior Graphic Designer

  • Nikola Morin

    November 23, 2020 at 4:27 pm

    I Guys!
    I Wrote This Expression like Dan Suggest:

    gap = 10;

    L = thisComp.layer(“text”).text.sourceText;

    rect = L.sourceRectAtTime(time,false);

    x = L.toComp([rect.left,0])[0];


    and the answer of After effect is L.sourceRectAtTime is not a function….
    don’t know what to do….
    I Using After Effect CC 2020 V.17.5.1

    Thank in Advance

  • Dan Ebberts

    November 23, 2020 at 4:47 pm

    Try changing the 2nd line to:

    L = thisComp.layer("text");

  • Nikola Morin

    November 23, 2020 at 4:54 pm

    Thank you very much, that’s Working!
    What will be the wordl without a Dan Ebbert??

  • Tanja Burgin

    May 27, 2022 at 9:17 pm

    Hi there

    I have a similar problem and unfortunately I can’t find a solution on the internet. Maybe someone can help me here?

    I have a background area (white) whose size adjusts to the text-layer. Now I want to add a colored bar in front of the background area. The position of the bar must adapt to the size of the background area. Unfortunately I can’t find a solution for this. How could I do that?

    Thanks a lot

    It should look like this (video) but with a colored bar in front of the white background (like the second row). There is also the Code I used (photo):

    – Formebene 1 = White Background

    – Name = Layer with Text

Page 2 of 2

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