Page 1 of 1

Can't change time stretch factor trough script

Posted: April 18th, 2023, 6:57 am
by matheusr.art

Hey guys, I'm starting to get into AE scripts and I'm loving it!

I just can't figure how to change the selected layer time stretch factor trough scripts, I've tried a few ways of doing it but nothing happens... the stretch factor still 100%, I'm trying to stretch it to 200% since it's something I do all the time in my workflow. Here are the scripts I already tried:

Code: Select all

var selectedLayer = app.project.activeItem.selectedLayers;
selectedLayer.timeStretch = 200;

Code: Select all

var selectedLayer = app.project.activeItem.Layer;
selectedLayer.timeStretch = 200;

Code: Select all

var selectedLayer = app.project.activeItem;
selectedLayer.timeStretch = 200;

Code: Select all

var selectedLayer = app.project.activeItem;
selectedLayer.layer.stretch = 200;

Can you guys help me figure out what I'm doing wrong?