Can't change time stretch factor trough script

What type of scripts do you need?

Moderator: byronnash

Post Reply
matheusr.art
Posts: 1
Joined: April 18th, 2023, 6:47 am

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?

Post Reply