Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Script to search for a layer and change scale/position automatically

  • Script to search for a layer and change scale/position automatically

    Posted by Patrick O’callaghan on July 14, 2013 at 6:23 pm

    Hi all,

    I hope you can help me, long time AE user but not very versed in scripting I’m afraid. I was wondering if there’s a script that could be run to find a specific layer in a project and then adjust its scale and position. It would be a predetermined layer and predetermined values if that’s of any help. There is an adjustment that needs to be done to several files that have the same issue. Adjusting the source footage is giving some discrepancies, and I’d like to see if there’s a way to avoid going into each project and doing the change manually. I’ve looked around the web but I haven’t found any answer so far.

    Thanks! 🙂

    Patrick O’callaghan replied 13 years ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    July 14, 2013 at 7:58 pm

    Assuming it’s a 2D layer with no position or scale keyframes and the comp is active, something like this should work:

    var layerName = “your layer name”;
    var newPosition = [100,100];
    var newScale = [100,100];
    var myLayer = app.project.activeItem.layer(layerName);
    myLayer.property(“Position”).setValue(newPosition);
    myLayer.property(“Scale”).setValue(newScale);

    You could modify it use the selected layer, or to find the comp by name.

    Dan

  • Patrick O’callaghan

    July 15, 2013 at 8:41 am

    Hi Dan,

    That’s great, thanks very much for your help; I’ll run with that and see where it gets me. All the best

    Cheers! 🙂
    Patrick

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