-
Script to change colors of all masks on a layer
I’m wondering how to return an array for all the masks on a layer. I’ve put some of the code into the expression box below for what I’m trying to do. Basically I want to press this button to turn all the masks red on a particular layer. Masks is returning ‘undefined’. I think it may not be returning an array? If so, what does that command return?
function OnRedClick() {
var activeItem = app.project.activeItem;
var layers = activeItem.selectedLayers;
for (var i = 0; i <layers.length; i++) {
var currLayer = layers[i];
//This is where I think my problem is:
var masks = currLayer.Masks;
for (var j = 0;j < masks.length; j++) {
var currMask = masks[j];
currMask.color = [1,0,0];
}
}
}