Possible Bug in getMGTComponent()?
I'm re-writing this post (and re-phrasing the title) because my earlier post was marked as spam, I've not heard back as to why, and I'm trying to complete a project I'm working on.
I've tested the following code with both an .mogrt that I created and a stock .mogrt from the Essential Graphics panel. With each one the .getMGTComponent() does not return the collection/array of components expected:
var oAS = app.project.activeSequence;
var oVtrks = app.project.activeSequence.videoTracks; //V1, V2
var oVCSTwo = oTrks[1].clips; //we want V2
var oAtrks = app.project.activeSequence.audioTracks; //A1, A2, A3
var oACSOne = oAtrks[0].clips; //we want A1
var markers = []; //empty array
for (var i=0; i < oACSOne.numItems; i++){markers.push(oACSOne[i].projectItem.getMarkers());}
var mkOne = markers[0].getFirstMarker(); // get 1st audio marker
//mogrt import params
var tTime = mkOne.start.ticks;
var vTS = mkOne.start.seconds;
var aTS = mkOne.start.seconds;
var mgrt = new File(File.encode("C:\\Program Files\\Adobe\\Adobe Premiere Pro CC 2019\\Essential Graphics\\Basic Title.mogrt"));
// import clobbers V1 if not locked
if (!(oVtrks[0].isLocked())){
oVtrks[0].setLocked();}
oTrkItem = oAS.importMGT(mgrt.fsName, tTime, vTS, aTS); //import mogrt
var oMC = oTrkItem.getMGTComponent();
There is a workaround, but it means writing six additional lines of code and I've not been able to successfully set the .mogrt text using it. Is there something I'm missing?
EDIT: I re-tested after upgrading to the latest PPro version and the problem persists.
