Skip to main content
Participating Frequently
Jan 3, 2025 12:10 AM UTC
Answered

Sequence.importMGT() overwrites sequence instead of inserting

Hey everyone,

 

I'd like to write a script that INSERTS a MOGRT at the head of the active sequence. The documentation here states that the time parameter will insert the MOGRT at the specified time but when I use the function it only overwrites. Code for ref:

var seq = app.project.activeSequence;
var path = "filepath_to_MOGRT";
var time = "0";
var importMgrt = seq.importMGT(path, time, 0, 0);

 

Bruce Bullis
Bruce BullisCorrect answer
Legend
Jan 3, 2025 6:32 PM UTC

You can use trackItem.move() on trackItems, regardless of their selection state; it can replicate the behavior you've described.

 

7 replies

Bruce Bullis
Legend
Jan 3, 2025 1:53 PM UTC

Yep; As you've found, there's no control over whether the .mogrt inserts or overwrites.

 

Any changes or improvements to PPro's APIs will need to wait until we've brought UXP Extensibility closer to 1:1 parity, with previous ExtendScript capabilities; no dates available.

Translate
EditManAuthor
Participating Frequently
Jan 3, 2025 6:27 PM UTC

Thanks for confirming Bruce.

 

To achieve something similar, would it be possible to use setSelected() to select all track items at once then shift everything down the timeline by a set time or does setSelected only work on individual trackItems? Also, is there a function that replicates when you select a track item and press +500 on the keyboard to shift the timeline by 5 seconds?

Translate
Bruce Bullis
Bruce BullisCorrect answer
Legend
Jan 3, 2025 6:32 PM UTC

You can use trackItem.move() on trackItems, regardless of their selection state; it can replicate the behavior you've described.

 

Translate