本来想用clip.start。表面上可以读写,但是会报错!!
所以要用try,这样会生效,再忽视错误即可
以下脚本为:移动视频第2轨的 第2个剪辑片段 对齐到 第1个剪辑片段的后面
// Move Next Clip To Previous End
var sequence = app.project.activeSequence; // active sequence
var clip1 = sequence.videoTracks[1].clips[0] // first clip
var clip2 = sequence.videoTracks[1].clips[1] // second clip
var new_end_time = clip2.end.seconds - clip2.start.seconds + clip1.end.seconds // second clip new end time , this way, dont change the clip duration
// use "clip.start" or "clip.end" will throw an error. I dont know why.
try {
clip2.start = clip1.end.seconds
} catch (error) {
try {
clip2.end = new_end_time
} catch (error) {
}
}