-
Scripting – Add to Essential Graphics Panel
I’m trying to use this code to write a script so that I can add properties to the Essential Graphics Panel. Here’s the reference code.
app.project.item(index).layer(index).propertySpec.addToMotionGraphicsTemplate(comp)I came up with this, but I’m totally new at this, so I might be completely off.
app.beginUndoGroup("Add to EGP");function add(){
var compName = app.project.activeItem.name;
var myLayer = app.project.activeItem.selectedLayers[0];
var propertySpec = myLayer.opacity;
propertySpec.addToMotionGraphicsTemplate(compName);}
add()
app.endUndoGroup();
I received this error message when I run it.
“Unable to execute script at line 7. After Effects error: Unable to call “addToMotionGraphicsTemplate” because of parameter 1. Comp 1 is not of the correct type.”