Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Change comp duration

  • Dan Ebberts

    August 10, 2011 at 5:46 pm

    I’m not at a compute with AE installed right now, but this should work:

    var myComp = app.project.activeItem;
    myComp.duration += 500*myComp.frameDuration;

    Dan

  • Stanislaff Fabiyanskiy

    August 11, 2011 at 1:36 pm

    thanks thanks thanks!

  • Luis Palencia

    September 13, 2017 at 1:40 pm

    Where do you write this expression? in a layer? can you send a screenshot plis? thank you very much!

  • Dan Ebberts

    September 13, 2017 at 5:10 pm

    It’s not an expression, it’s a script. So you would run it either in the ExtendScript editor, or as a stand-alone .jsx file using AE’s File>Scritps>Run Script File… menu item.

    Dan

  • Luis Palencia

    September 13, 2017 at 6:51 pm

    Oh thank you very much.

    Is there any expression that allows adjust the duration of a composition?

    What I want to do is change the duration of many composition, each composition has a layer text, I want to change the duration of composition as long as the length of the text.

    For example:

    Composition1
    Text: “Hello, Word”
    Duration of Composition1 = 5 seconds (for example)

    Composition2
    Text: “Hello, Word. The sky is blue and the children play in the park”
    Duration of Composition2 = 15 seconds (for example)

    I want to calculate the length of the text with “text.sourcetext.length” and that multiplicate for 1 second and the result apply to the duration of that composition.

    Can you help me t_t ???

  • Dan Ebberts

    September 13, 2017 at 6:59 pm

    An expression can’t do that. You could do it with a script, but you’d have to run the script each time you wanted to update the comp durations.

    Dan

  • Luis Palencia

    September 13, 2017 at 8:02 pm

    And an expression to modify the duration of a text layer?

  • Dan Ebberts

    September 13, 2017 at 8:09 pm

    Expressions can’t modify the duration of anything. The best you could do is an expression to control the opacity. Otherwise, it would have to be a script.

    Dan

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