How to correctly get and set text in an Essential Graphic (AE.ADBE Capsule) ComponentParam?
Hi everyone,
I am developing a UXP plugin for Premiere Pro (v25+) and I'm trying to programmatically update the text properties of a native Essential Graphic clip (MatchName: AE.ADBE Capsule or Graphic Parameters) on the timeline.
I am successfully traversing the sequence, finding the correct track item, getting its ComponentChain, and iterating through the ComponentParams. However, I am facing several roadblocks when trying to read and update the actual text value using the new UXP API.
Here is what happens when I try to GET the text value: When I try to use param.getValueAtTime(pos) to read the current text (so I can preserve the JSON styling like fontFamily, fontSize, etc., and only change textEditValue), Premiere throws this error:
"getValueAtTime is not supported for these value types. Use GetKeyframeAtTime to get a keyframe object at time. The value can be extracted from the keyframe object."
Following the documentation, I also tried getting the keyframe using param.getKeyframePtr(pos) or param.getStartValue(), but it's unclear how to properly extract the JSON object/string from the returned Keyframe.
Here is what happens when I try to SET the text value: Based on the official UXP ComponentParam documentation, I tried the new createKeyframe and createSetValueAction approach:
javascript
// Example of what we tried:
const newKf = param.createKeyframe(newTextString); // Also tried passing stringified JSON
const action = param.createSetValueAction(newKf, true);
await project.executeTransaction(ca => {
ca.addAction(action);
}, "Update Graphic Text");
When passing an object, it throws: Illegal Parameter type. When passing a string or stringified JSON, the execution passes without errors, but the text on the timeline does not update at all.
My questions:
- What is the correct API call in UXP to retrieve the current text value (or JSON string) of a Graphic Parameter to avoid losing font styles?
- What is the correct data type (String, JSON, Object?) expected by
param.createKeyframe()when dealing with Essential Graphic text layers? - Is there a working code snippet for modifying a Text Param inside
AE.ADBE Capsuleusing the new UXPexecuteTransactionworkflow?
Any help or guidance would be greatly appreciated. Thank you!