change the text of a MOGRT with ExtendScript in Premiere Pro 2023
Hello,
I'm looking for a way to modify a Mogrt with ExtendScript but I can't find it.
I have a Text in a Mogrt called "SRT Data". I would like to code the fact that it takes the selected mogrt and modifies the text with my variable.
app.enableQE();
var sequence = app.project.activeSequence;
var videoTracks = sequence.videoTracks;
var mogrtClip;
for (var i = 0; i < videoTracks.numTracks; i++) {
var track = videoTracks[i];
for (var j = 0; j < track.clips.numItems; j++) {
var clip = track.clips[j];
if (clip.isMGT() && clip.isSelected()) {
mogrtClip = clip;
break;
}
}
}
if (mogrtClip) {
var mogrtProperties = mogrtClip.getMGTComponent().properties;
for (var i = 0; i < mogrtProperties.numProperties; i++) {
var property = mogrtProperties[i];
if (property.displayName == "SRT Data") {
property.setValue("New Text", true);
}
}
}
the problem is that "mogrtProperties" is undefined. I would like to know if I'm doing it wrong, I've already looked at other forums and they did it like this
Thank you for your help!
