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

change the text of a MOGRT with ExtendScript in Premiere Pro 2023

New Here ,
May 09, 2023 May 09, 2023

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!

TOPICS
SDK

Views

577

Translate

Translate

Report

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 1 Correct answer

Adobe Employee , May 09, 2023 May 09, 2023

The API works with AE .mogrts; if the MGTComponent is null, the properties of that .mogrt cannot be changed.

Votes

Translate

Translate
Adobe Employee ,
May 09, 2023 May 09, 2023

Copy link to clipboard

Copied

The API works with AE .mogrts; if the MGTComponent is null, the properties of that .mogrt cannot be changed.

Votes

Translate

Translate

Report

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
New Here ,
May 10, 2023 May 10, 2023

Copy link to clipboard

Copied

LATEST

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?

Votes

Translate

Translate

Report

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