Change 'Fill Color' and 'Source Text' in a MOGRT via ExtendScript (PPro CC2019)
So I have a newbie question on changing properties from within a selected MOGRT on a timeline in Premiere Pro.
I can provided both a test MOGRT and JSX file to better explain what I am trying to achieve (I tried attaching them, but got an unsupported file type error). I also copy/pasted the script below:
//testScript_01
var trackItems = app.project.activeSequence.videoTracks.numTracks; //number of tracks
for(i=0;i<trackItems;i++){ //for each track
var clipItems = app.project.activeSequence.videoTracks[i].clips.numItems; //number of clips in current track
for (c=0;c<clipItems;c++){ //for each clip within the current track
var selectedMOGRT = app.project.activeSequence.videoTracks[i].clips[c]; //currently targeted clip
//selectedMOGRT.setSelected(true);
if (selectedMOGRT.isSelected() == true){ //if targeted clip is a selected in timeline
if(selectedMOGRT.isMGT() == true){ //if selected clip is a MOGRT
var component = selectedMOGRT.getMGTComponent(); //get all MOGRT component properties
var c = 2; //USER VARIABLE for component to change
var v = 25; //USER VARIABLE for new value
var comp = component.properties[c].getValue();alert(comp); $.write(comp); //gets current value for component[c] and alerts/writes it
component.properties[c].setValue(v,1); //sets new value for component[c] as user variable
};
};
};
};
The MOGRT basically has 3 properties to change: 0 - Slider Controller, 1 - Color Fill, and 2 - Source Text (with cutom font and faux styles enabled).
I managed to access the component properties of the MOGRT but can't seem to figure out the correct values to input for 'Fill Color' or 'Source Text.'
For the slider (component.properties[0]), I get an expected value of 100 which I can easily change (to 25 in the example)
But I get a weird value for component.properties[1] color ('72337971214286848' I think it's decimal? Can't figure out how to convert to hex.) and a long array string for component.properties[2] text. When I try to change either one using the same method, I get an error. Even copy/pasting the same values given from .getValue() throws an error. Not sure what I am doing wrong?
Please help.
