Skip to main content
Participating Frequently
January 3, 2025
Answered

Sequence.importMGT() overwrites sequence instead of inserting

  • January 3, 2025
  • 1 reply
  • 639 views

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);

 

Correct answer Bruce Bullis

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

 

1 reply

Bruce Bullis
Community Manager
Community Manager
January 3, 2025

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.

EditManAuthor
Participating Frequently
January 3, 2025

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?

Bruce Bullis
Community Manager
Bruce BullisCommunity ManagerCorrect answer
Community Manager
January 3, 2025

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