-
selectLayers script
I understand that selected layers, requires a bit more brain hurt, but to get a selected item
for(var i = 0; i <= 3 ; i++ ){
b[i].onClick =
(function(i){
return function() {
app.beginUndoGroup(“AddEffect”);
var curItem = app.project.activeItem;
var selectedLayers = curItem.selectedLayers;try{
var curRem = curItem.selectedLayers[0].effect.property(“Fill”).remove();
var curLayer = curItem.selectedLayers[0].Effects.addProperty(“ADBE Fill”)(“Color”).setValue(pcolor[i])
}catch(err){
var curLayer = curItem.selectedLayers[0].Effects.addProperty(“ADBE Fill”)(“Color”).setValue(pcolor[i]);
}app.endUndoGroup();
}
})(i);
}This works brilliantly, but I’ve tried a few different ways to select multiple layers and get it to work, but the
})(i);
part towards the end, keeps flagging errors with me.
Any ideas?