Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Can these things be done using scripts?

  • Can these things be done using scripts?

    Posted by Noelia Sanchez on April 15, 2018 at 7:41 pm

    Hello

    I try to make my first after effects script. Actually, it should be a toolbox which will help me and the other persons who want to use it speed up the workflow.
    I already created the interface, it has a move anchor point section, a create new… section, but now I am stuck …
    I would like to add a couple more things on it but I can’t find a way to make them work using scripts…I have very little scripting knowledge.
    Can anyone help me please with these things:

    1. At button click change the startTime of the selected layer/layers to the playhead time…make the layer start where the playhead is, the same thing that [ shortcut does.

    2. At button click move forward 10 frames (the same thing that page up shortcut does)

    3. At button click add an effect, for example, the Fill effect to the selected layer/layers.

    I would be very thankful to any of you who can help me.

    Thank you in advance!

    Noelia Sanchez replied 8 years, 3 months ago 2 Members · 3 Replies
  • 3 Replies
  • Dan Ebberts

    April 15, 2018 at 10:45 pm

    // 1
    var myComp = app.project.activeItem;
    var myLayer = myComp.layer(1);
    myLayer.startTime = myComp.time – (myLayer.inPoint – myLayer.startTime);

    //2
    var myComp = app.project.activeItem;
    myComp.time += 10*myComp.frameDuration;

    //3
    var myComp = app.project.activeItem;
    var myLayer = myComp.layer(1);
    myLayer.property(“Effects”).addProperty(“Fill”);

    Dan

  • Dan Ebberts

    April 15, 2018 at 10:54 pm

    Oops, I missed the selected layers part. Here’s the first one modified for that requirement:


    var myComp = app.project.activeItem;
    var myLayer;
    for (var i = 0; i < myComp.selectedLayers.length; i++){
    myLayer = myComp.selectedLayers[i];
    myLayer.startTime = myComp.time - (myLayer.inPoint - myLayer.startTime);
    }

    Dan

  • Noelia Sanchez

    April 16, 2018 at 9:47 am

    Thank you very, very, very much!!! You are a genius!

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