Extendscript: Modifying MOGRT Text Using CEP Panel
Hi, I'm trying to edit a Text field in a Motion Graphics Template using code in my CEP panel, but am running into issues. This is my code:
var components = newMOGRT.getMGTComponent();
components.properties.getParamForDisplayName("Text").setValue(customText);This is doing exactly what I want in Premiere versions 13.1.5 and 14.0 (setting the text in the MOGRT to the value of the string variable customText). However, in Premiere 14.1 and 14.2, this doesn't change the text at all.
After reading this thread and this other one, I tried getting and setting the JSON object from the text field instead. So I changed the above code to this:
var components = newMOGRT.getMGTComponent();
var textObj = JSON.parse(components.properties.getParamForDisplayName("Text").getValue());
var theText = textObj.textEditValue;
textObj.textEditValue = "testing";
components.properties.getParamForDisplayName("Text").setValue(JSON.stringify(textObj), true);This updates the MOGRT's text to "testing" in the Essential Graphics panel, but not in the Program Monitor. Instead no text shows up at all when I'm looking at the MOGRT. I'm able to get and set all sorts of other values like checkboxes and color controls in this MOGRT, but only text isn't working. It seemed to be working for users on those other threads so I'm at a loss. Is there something I'm missing?
My OS is macOS Catalina. Thanks!
