-
if/else exists expression
for (var i = 1; i <= myComp.numLayers; i++){
var myComp = app.project.activeItem;
var nNum = myComp.layer(i).effect(“Name”)(“Slider”).value;
var name = myObject[nNum].name;
myComp.layer(i).name = name;
};I’m having a little problem with my script.
My name layers will never be the same, but the ones I want to effect will all have the slider “Name”…Again value will differ. The number is for my JSON reference…
Now…The above expression in my script works fine, if I don’t have any other layers that have no slider or a different slider.
I don’t have a way to reference the content of the slider, so I need it to say “if I exist change me else continue” I’ve tried a few things with no success.
I’m sure I’ve read someone with a similar situation, but I’ve read about 50 different forums and can’t find anything. Any ideas?