Forums › Adobe After Effects Expressions › Extendscript naming Dropdown Menu effect
Extendscript naming Dropdown Menu effect
Willem de Rue
February 25, 2020 at 10:10 amHello,
I’m writing a simple script where I add a dropdown menu effect to a layer, but I can’t seem to rename the Dropdown Menu effect like with for instance a slider effect.
var dropdownItems = [
"Left",
"Center",
"Right"
];
boxLayerDropdown = boxLayer.Effects.addProperty("ADBE Dropdown Control");
boxLayerDropdown.property(1).setPropertyParameters(dropdownItems);
boxLayerDropdown.name = "Align";
What am I doing wrong here?
Regards,
Wim
this throws “Object is invalid, while this is fine:
boxLayerslider= boxLayer.Effects.addProperty("ADBE Slider Control");
boxLayerslider.name = "Rounded corners";
Alex Munteanu
February 25, 2020 at 8:04 pmI haven’t tested ‘Dropdown’ controls much.
When I try to get their matchName they also showup as a Pseudo-effect, which is a bit weird.
Anyways… what you could do instead is to rename the last added effect.boxLayer.Effects.property(boxLayer.Effects.numProperties).name = "Align";
Dan Ebberts
February 25, 2020 at 8:13 pmThe dropdown control is an unusual implementation. You could try this:
var dropdownItems = [
"Left",
"Center",
"Right"
];
var boxLayerDropdown = boxLayer.Effects.addProperty("ADBE Dropdown Control");
var temp = boxLayerDropdown.property(1).setPropertyParameters(dropdownItems);
temp.propertyGroup(1).name = "Align";
Dan
Willem de Rue
February 27, 2020 at 8:43 amThanks Dan, that did the trick (of course)!
Log in to reply.