Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Nudge frames in scripting

  • Nudge frames in scripting

    Posted by Terje Lundgren on October 9, 2015 at 8:36 am

    If you were to go back one frame (equivalent to Page Up), how would you calculate that in a script?

    // move CTI one frame back
    curTime = activeItem.time;
    newTime = curTime-1;
    selectedLayer.timeRemap.addKey(newTime);

    /Terje

    Terje Lundgren replied 10 years, 7 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    October 9, 2015 at 5:05 pm

    Like this, I think:

    var myComp = app.project.activeItem;
    myComp.time = myComp.time – myComp.frameDuration;

    Dan

  • Terje Lundgren

    October 10, 2015 at 8:53 pm

    Thanks Dan. Finally, I think the penny dropped on how to move about in the timeline with frame accuracy.

    var myComp = app.project.activeItem;
    var t = myComp.frameDuration;
    var myLayer = app.project.item(3).layer("Black Solid 1");
    myComp.time = myLayer.startTime;
    var goTo = parseFloat(prompt("Go to frame"));
    myComp.time = myComp.frameDuration*goTo;
    alert(myComp.time);

    /Terje

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