Copy link to clipboard
Copied
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);
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.
You can use trackItem.move() on trackItems, regardless of their selection state; it can replicate the behavior you've described.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
You can use trackItem.move() on trackItems, regardless of their selection state; it can replicate the behavior you've described.
Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
You'll need to loop, on your own.
Copy link to clipboard
Copied
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();
Copy link to clipboard
Copied
You can check any trackItem for .mogrt components, like PProPanel does.
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more