Copy link to clipboard
Copied
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!
The API works with AE .mogrts; if the MGTComponent is null, the properties of that .mogrt cannot be changed.
Copy link to clipboard
Copied
The API works with AE .mogrts; if the MGTComponent is null, the properties of that .mogrt cannot be changed.
Copy link to clipboard
Copied
Thank you for your reply,
I would like to know how you can give access to modify the properties and also I made a mistake:
It is not mogrtProperties which is undefined but rather mogrtProperties.numProperties. I would like to know if this method exists?