Activity › Forums › Adobe After Effects Expressions › Change comp duration
-
Change comp duration
Posted by Stanislaff Fabiyanskiy on August 10, 2011 at 4:45 pmHow i can change composition duration with a script?
like this
var change = app.project.activeitem.duration
make change + 500 framesthanks
Dan Ebberts replied 8 years, 8 months ago 3 Members · 8 Replies -
8 Replies
-
Dan Ebberts
August 10, 2011 at 5:46 pmI’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
-
Luis Palencia
September 13, 2017 at 1:40 pmWhere 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 pmIt’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 pmOh 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 pmAn 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 pmAnd an expression to modify the duration of a text layer?
-
Dan Ebberts
September 13, 2017 at 8:09 pmExpressions 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
Reply to this Discussion! Login or Sign Up