function showMyLayers() {
var Mylayers = [
["ISO"],
["ODO"],
["Black Round Mask"],
["red glow on gauges"],
["Compass"],
["4 Gauges"],
["Upper Stainless Steel"],
["Background"]
];
for (x in Mylayers) {
var activelayer = app.activeDocument.layers[x];
activelayer.visible = true;
activelayer = null;
}
} showMyLayers();
it errors out on:
[“4 Gauges”],
assuming the number is messing with the array. any ideas why? this is extendscript which is javascript but for photoshop in case you’re wondering. but its based on JS for most part so it should behave like it.
The
for..inloop is to iterate over objects. To iterate over arrays, use a classicforloop. Further more, what you have there is an array of array, which is probably not what you want.