Assign espression to selected property after adding effect
Posted: November 24th, 2014, 1:40 pm
Im having a problem finding a simple solution with this. I want to add an expression on selected property after i create a few sliders on the same layer. But, once you use .addProperty application seems to lose the selection (property selection, at least).
So, if this:
actually does not work because after adding a slider, selectedProperty is not valid any more.
Any ideas how to get around this without inventing some convoluted way of traversing through parent properties to find out the full path just so i can recall it after i lose the selection?
Thanks to anyone who points out something obvious that im missing and saves me a lot of trouble...
So, if this:
Code: Select all
var selectedProperty = selectedLayer.selectedProperties[0];
var addSlider = selectedLayer.Effects.addProperty("ADBE Slider Control");
selectedProperty.expression = "my expression";
Any ideas how to get around this without inventing some convoluted way of traversing through parent properties to find out the full path just so i can recall it after i lose the selection?
Thanks to anyone who points out something obvious that im missing and saves me a lot of trouble...