toggle - JSX/Photoshop: Toggling non selected layer visibility by name? -
i'm using piece hide/show selected layer:
app.activedocument.activelayer.visible = !app.activedocument.activelayer.visible;
i wonder if there exist way of toggling non selected layer it's name.
many thanks
update:
i got working thing (i know, must cleaned):
function togglelayer() { for( var = 0; < app.activedocument.artlayers.length; i++) { if (app.activedocument.artlayers[i].name == "thelayer"){ app.activedocument.artlayers[i].alllocked = false; app.activedocument.artlayers[i].visible = !app.activedocument.artlayers[i].visible; } } }
i'd know if can same without loop.
thanks
here solution did write. unexpectedly worked :p
function togglelayer() { var tl = app.activedocument.layers["thelayer"]; tl.visible = !tl.visible; } togglelayer();
now, have doubt: whats difference between "layers" , "artlayers"?
cheers
toggle visibility photoshop layer jsx
No comments:
Post a Comment