Copy link to clipboard
Copied
Hi, I have found related topics to this matter, however haven't found an answer yet.
I have a simple text layer, please see a screenshot.
I am able to find it, but when I try to set a value, it just empties the text. Furthermore, when I call the getValue() method it returns garbage:
ì
I tried to set the json from this post https://community.adobe.com/t5/premiere-pro-discussions/mogrt-getvalue-returns-json-in-extendscript/...
But it also reset the text layer, even with chaingin the font family to Tahoma.
function set_flag_title(sequences,title) {
var flagTitleItem = get_sequence_by_name(sequences, "Logo Text Comp");
if(flagTitleItem && flagTitleItem.videoTracks) {
var titleVideoTrack = flagTitleItem.videoTracks[2];
var firstClip = titleVideoTrack.clips[0];
for (var i = 0; i <= firstClip.components.length; i++) {
var component = firstClip.components[i];
if (component == null) {
continue;
}
$.writeln("Component:");
$.writeln(component.displayName);
if(component.displayName == "Text") {
var properties = component.properties;
var textProp = properties.getParamForDisplayName("Source Text");
$.writeln(textProp.getValue());
// textProp.setValue(title);
// var objStr = JSON.parse(textProp.getValue());
// $.writeln(objStr);
// textProp.setValue(JSON.stringify(textParamsJson), 1);
}
}
}
}
It should be a quite easy task to set the text, however I've spent two days already dealing with this issue.
Kind regards.
The API is designed to act upon .mogrts created in AE, and PProPanel successfully imports and manipulates them.
In what application was the .mogrt you're using, created?
Copy link to clipboard
Copied
The API is designed to act upon .mogrts created in AE, and PProPanel successfully imports and manipulates them.
In what application was the .mogrt you're using, created?
Copy link to clipboard
Copied
Did you get this to work? Can you let me know how you solved it please?
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more