ExtendScript: How to retain Effects when copying TrackItems between Sequences?
Hi everyone,
I am currently developing a script to automate a Transition Pack workflow in Premiere Pro. My goal is to copy specific clips—specifically Adjustment Layers with various Effects—from a "Source Sequence" into a "Main Sequence."
I’ve been studying the approach discussed in this 3-year-old thread: Get videoTracks from projectItem and copy video/audioTracks to main sequence
In that discussion, it was suggested to use sequence.clone() and delete unwanted items as a workaround for the lack of a direct "Un-nested" sequence insertion API.
My current implementation:
-
I use
sequence.clone()to get a copy of the source sequence containing the transition. -
I iterate through the tracks of the cloned sequence to find the target
trackItem. -
I retrieve the source via
trackItem.projectItem. -
I then use
videoTrack.insertClip(projectItem, time)to place that item into my Main Sequence.
The Problem: While the clip is successfully placed in the Main Sequence, all Effects attached to the original trackItem are lost. It reverts to a "clean" Adjustment Layer.
It seems that trackItem.projectItem only references the raw asset in the Project Panel, not the specific "instance" on the timeline that holds the effect data. However, if I manually use Ctrl+C / Ctrl+V in the Premiere UI, all effects and keyframes are preserved perfectly.
My Questions:
-
Is there any way via ExtendScript to copy a TrackItem including its Effects/Keyframes from one sequence to another?
-
Since the API cannot toggle the "Insert and overwrite sequences as nests or individual clips" button, is there a way to "merge" the content of my cloned sequence into the Main Sequence while keeping the track items' effects intact?
-
If
insertClip()always results in a clean clip, what is the recommended professional workaround for automating transition packs that rely on Adjustment Layers?
Any insights or guidance from the community would be greatly appreciated. Thank you!
