Renaming a Slider or Dropdown
So the code I'm working with (full code below!) works, I just don't understand - on the last line, why does
Code: Select all
property(1)
need to be a parent of
Code: Select all
propertyGroup(1)
When I take either one out or shuffle them around, the code no longer works, so it must be important, I just don't understand why. Can anyone explain? In plain English - what are those two referring to and why in that order? Thanks!!
Full code:
Code: Select all
var myComp = app.project.activeItem;
boxLayer = myComp.layer(1);
var dropdownItems = [
"Item 1",
"Item 2",
"Item 3"
];
var boxLayerDropdown = boxLayer.Effects.addProperty("ADBE Dropdown Control");
var temp = boxLayerDropdown.property(1).setPropertyParameters(dropdownItems);
temp.propertyGroup(1).name = "This Is My New Dropdown Name";
var boxLayerSlider = boxLayer.Effects.addProperty("ADBE Slider Control");
var temp = boxLayerSlider.property(1).propertyGroup(1).name = "This Is My New Slider Name";