-
Add the Animate Fill Color RGB to text layer
I am trying to create a script that add the Fill Color RGB to selected text layers.
here is the code so far
// Create a new window for the UI panel
var myPanel = new Window(“palette”, “Add RGB Fill”, undefined);
// Add a button to the panel
var myButton = myPanel.add(“button”, undefined, “Add RGB Fill Color”);
// Add an event listener to the button
myButton.onClick = function() {
// Get the active composition
var activeComp = app.project.activeItem;
if (!(activeComp instanceof CompItem)) {
alert(“Please select a text layer in the active composition.”);
return;
}
// Get the selected text layers
var selectedLayers = activeComp.selectedLayers;
if (selectedLayers.length == 0) {
alert(“Please select at least one text layer.”);
return;
}
for (var i = 0; i < selectedLayers.length; i++) {
var textLayer = selectedLayers[i];
if (!(textLayer instanceof TextLayer)) {
alert(“Please select only text layers.”);
return;
}
// get the text path
var PickColor = textLayer.property(“Text”);
//after getting this path, how can I add the animate Fill Color RGB?
}
// Show the UI panel
myPanel.show();
Any help?