Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions ExtendScript: One Layer’s Position = Another Layer’s Position + 100 on Y?

  • ExtendScript: One Layer’s Position = Another Layer’s Position + 100 on Y?

    Posted by Andy Troz on July 17, 2013 at 4:43 am

    Hello wonderful people! Another ExtendScript question:

    How can I have one layer’s position = another layer’s position + 100 on the Y Axis?

    Here’s my horrible attempt:


    var theFinalOutput = app.project.selection[0];
    var layer01 = theFinalOutput.layers[1];
    var layer02 = theFinalOutput.layers[2];

    layer02.property("position")= layer01.property("position")+[0,100,0];

    Thanks in advance! 🙂

    Andy Troz replied 13 years, 1 month ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    July 17, 2013 at 4:21 pm

    I haven’t test this, but for scripting, you have to use setValue(), like this:

    layer02.property(“Position”).setValue(layer01.property(“Position”).value+[0,100,0]);

    Dan

  • Andy Troz

    July 17, 2013 at 11:59 pm

    Dan, I can’t thank you enough!

    Best,
    Andy.

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