ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Extendscript naming Dropdown Menu effect

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Willem de Rue
Extendscript naming Dropdown Menu effect
on Feb 25, 2020 at 10:10:42 am

Hello,

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";


Return to posts index

Alex Munteanu
Re: Extendscript naming Dropdown Menu effect
on Feb 25, 2020 at 8:04:17 pm

I 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";


Return to posts index

Dan Ebberts
Re: Extendscript naming Dropdown Menu effect
on Feb 25, 2020 at 8:13:20 pm

The 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



Return to posts index


Willem de Rue
Re: Extendscript naming Dropdown Menu effect
on Feb 27, 2020 at 8:43:29 am

Thanks Dan, that did the trick (of course)!


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2020 CreativeCOW.net All Rights Reserved
[TOP]