Skip to main content
Tcsshri
Participant
August 27, 2015
Answered

duration in composition

  • August 27, 2015
  • 1 reply
  • 645 views

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

This topic has been closed for replies.
Correct answer Alex White

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

1 reply

Alex White
Alex WhiteCorrect answer
Legend
August 27, 2015

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

Tcsshri
TcsshriAuthor
Participant
August 28, 2015

Thanks Alex,

               You have made me to go one step ahead.

Thanks for your help once again