Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Creating a “Duplicating a layer and trimming” script

  • Creating a “Duplicating a layer and trimming” script

    Posted by Jordan Montreuil on January 4, 2011 at 5:50 pm

    I need a script that duplicates a layer, trims it at the current time and moves it up layer. I know the shortcut keys for these three actions (Command+D, Alt+[, Shift+]) but I don’t know how to translate that into a script I can run whenever.

    Jordan Montreuil replied 15 years, 4 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    January 4, 2011 at 6:08 pm

    The first two parts would be like this (assumes layer is selected):

    {
    var myComp = app.project.activeItem;
    var myLayer = myComp.selectedLayers[0];
    var myNewLayer = myLayer.duplicate();
    myNewLayer.inPoint = myComp.time;
    }

    I’m not sure what your third shortcut does.

    Dan

  • Jordan Montreuil

    January 5, 2011 at 4:49 pm

    The third shortcut moves the selected layer up in the order. If it was at the bottom, it moves it up to the second from the bottom layer.

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