Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
Locked
1

Sequence.importMGT() overwrites sequence instead of inserting

Community Beginner ,
Jan 02, 2025 Jan 02, 2025

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

 

TOPICS
SDK
746
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 2 Correct answers

Adobe Employee , Jan 03, 2025 Jan 03, 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.

Translate
Adobe Employee , Jan 03, 2025 Jan 03, 2025

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

 

Translate
Adobe Employee ,
Jan 03, 2025 Jan 03, 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jan 03, 2025 Jan 03, 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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Jan 03, 2025 Jan 03, 2025

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

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jan 03, 2025 Jan 03, 2025

Amazing, thank you! Is there an index I can pass that will move everything all at once or will I have to loop through the video tracks and track items then move them individually?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Jan 03, 2025 Jan 03, 2025

You'll need to loop, on your own.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jan 03, 2025 Jan 03, 2025

Got it! Sorry one last question:

 

Does getMGTComponent(); have to be used in conjunction with an import MOGRT function like importMGT(path, time, 0, 0) or can I do something like this:

var mogrt = app.project.activeSequence.videoTracks[0].clips[0];
var components = mogrt.getMGTComponent();

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Jan 04, 2025 Jan 04, 2025
LATEST

You can check any trackItem for .mogrt components, like PProPanel does.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines