Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Forums Adobe After Effects Expressions control inpoint/starttime with script

  • control inpoint/starttime with script

  • Otto Tasnadi

    October 22, 2021 at 6:47 am

    Hey, I have a script that I use as an extend script before calling some other scrits thought CLI.

    This script changes the length of a composition mentioned in a json file.

    it looks like this:

    var myTime = $D.job.get(“time”);
    var myTarget = $D.job.get(“compname”);
    var start_comp = $D.job.get(“start_time1”);
    var myComp;
    for (var i = 1; i <= app.project.numItems; i ++) {
    if ((app.project.item(i) instanceof CompItem) && (app.project.item(i).name === myTarget)) {
    myComp = app.project.item(i);
    myComp.duration = (myTime);

    I want to add to control inPoint or startTime to this but it does not seem to work.

    I found a way to do this like without using the data from json and with layer index

    var proj = app.project;

    var myComp = proj.item(1);
    myComp.layer(1).startTime = 3;

    I want to use it like the upper example by taking the compname and my_start_time from the json. I can’t figure it out how.

  • Andrei Popa

    October 22, 2021 at 6:47 pm

    When you set the duration of the composition it is a composition object. You can’t set the startTime of a composition object. For startTime, you need a layer object. That means that first you have to put your composition inside another composition. When you have done that, you have your composition used as an AVLayer inside the second composition. Only on this one can you set the startTime.

Viewing 1 - 2 of 2 posts

Log in to reply.

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