Skip to main content
Participant
August 30, 2023
Question

Script to fit clips in different tracks.

  • August 30, 2023
  • 1 reply
  • 157 views

Good afternoon. The bottom line is that you need to automatically adjust the beginning of the second clip in the second track to the beginning of the third from the end of the clip in the first track in the active sequence. And the script is even executed in the environment itself, but stops at the line and does not go any further. Tell me what is the reason? Where is the mistake? Thank you

This topic has been closed for replies.

1 reply

Participant
August 30, 2023

var project = app.project;
var sequence = project.activeSequence;

var videoTrack_1 = sequence.videoTracks[0]; // первая видеодорожка с основными клипами
var videoTrack_3 = sequence.videoTracks[2]; // третья видеодорожка с сердечками

var numVideoClips_1 = videoTrack_1.clips.numItems; //количество клипов в первой видеодорожке

videoTrack_3.clips[1].start = videoTrack_1.clips[(numVideoClips_1)-3].start;
videoTrack_3.clips[1].end.ticks = videoTrack_1.clips[(numVideoClips_1)-3].end.ticks;
videoTrack_3.clips[0].end.ticks = videoTrack_1.clips[(numVideoClips_1)-5].end.ticks;