Copy link to clipboard
Copied
Hi,
I am new to After effect scripting. can you please tell me how to change (increase and decrease values) the composition duration through script .

Thanks
After Effects scripting reference page 31
AVItem duration attribute
app.project.item(index).duration
Description
Returns the duration, in seconds, of the item. Still footage items have a duration of 0.
• In a CompItem, the value is linked to the duration of the composition, and is read/write.
• In a FootageItem, the value is linked to the duration of the mainSource object, and is read-only.
Type
Floating-point value in the range [0.0..10800.0]; read/write for a CompItem; otherwise, read-only.
...var myComp
Copy link to clipboard
Copied
After Effects scripting reference page 31
AVItem duration attribute
app.project.item(index).duration
Description
Returns the duration, in seconds, of the item. Still footage items have a duration of 0.
• In a CompItem, the value is linked to the duration of the composition, and is read/write.
• In a FootageItem, the value is linked to the duration of the mainSource object, and is read-only.
Type
Floating-point value in the range [0.0..10800.0]; read/write for a CompItem; otherwise, read-only.
var myComp = app.project.activeItem;
myComp.duration = 10; // set duration
Copy link to clipboard
Copied
Thanks Alex,
You have made me to go one step ahead.
Thanks for your help once again
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more