Copy link to clipboard
Copied
This is a continuation of my last question Mogrt getValue returns JSON in Extendscript
Although I was succesfull in setting a new text into the Mogrt template I have noticed a quirk.
The Mogrt template I created in Premier Pro was a simple text with a rectagle background, the text had the string "This is a sample test" in it. The string length is 21 characters.
In extendscript I load the template onto the timeline using "seq.importMGT()".
However I noticed that if I set a new text into the Mogrt longer than the 21 characters the text just vanishes.
I am able to set texts below the 21 character limit.
I also played around with the "start" and "end" properties of the text component but to no avail.
Is there a way around to this?
I am thing of creating a new template and placing a long string into it, lets say 255 chars that would probably suffice for my needs, hopefull that mitigates this issue.
In the meanwhile I hope the more experienced folks over here share their experiences if any that can resolve this without resorting to a template with extremely long text.
There is currently no way to circumvent that limitation, but such circumvention has been requested (DVAPR-4212165); I've added your vote.
Copy link to clipboard
Copied
So I did a test, with another template, I created a new Mogrt and add a text into it with around 255 characters. Now I save this as a template. And I can use strings as long as 255 characters to set new text into it.
This seems to work for now, but just wondering what the character limit is for and whether we can send some commands to the Mogrt to circumvent it.
Copy link to clipboard
Copied
There is currently no way to circumvent that limitation, but such circumvention has been requested (DVAPR-4212165); I've added your vote.
Copy link to clipboard
Copied
hellow sir i am also going through the same issue and found that you have found a workaround for setting text to mogart created in premere pro , as i am a non coder but have a bit of knowledge of runing scripts via vscode - can you help me debuging this script as it is giving me error "21 null is not an object" =
Copy link to clipboard
Copied
var seq = app.project.activeSequence;
var jsonVal = seq.videoTracks[0].clips[0].components[2].properties.getParamForDisplayName("Source Text").getValue();
var jsonObjPart = jsonVal.substring(0, 4);
var jsonObj = JSON.parse(jsonVal.substring(4));
jsonObj.mTextParam.mStyleSheet.mText = "This is a new text";
var jsonOutstr = JSON.stringify(jsonObj);
var jsonOutstr = jsonObjPart + jsonOutstr;
seq.videoTracks[0].clips[0].components[2].properties.getParamForDisplayName("Source Text").setValue(jsonOutstr, true);
Copy link to clipboard
Copied
Manipulation of a .mogrt's JSON is completely unsupported, and not recommended.
Which line in that code, results in the error?