Hello, kamalakas .
You’re right, sorry for the delay, but you know, because of work, I work as a chartered accountant at Ford and in my spare time I practice my hobby.
This is clean and working code
/////////////////////////////////////////////////////////////////////////////////////
///////// MY WORKE MOHAMAD FATHI 🚀🚀 BOOST_Show_Hide🚀🚀 /////////
/////////////////////////////////////////////////////////////////////////////////////
// BOOST_Show_Hide...(How to change layer BOOST_Show_Hide by name inside a group).
const BOOST_Show_Hide = async () => {
let wantedLayer = "BOOST"
await ExecuteAsModal(async () => {
let doc = app.activeDocument;
doc.layers.forEach(layer => {
if (layer.kind == "group") {
layer.layers.forEach(gLayer => {
//now looping through group layers : one level deeper
if (gLayer.name == wantedLayer) {
//layer found
// you can also check its kind if you like to
gLayer.visible = !gLayer.visible
}
})
}
})
}, { "commandName": "layer visible..." }) //executeAsModal :: END
console.log("BOOST_Show_Hide Result!!!")
}
With regards…
Mohamed Fathi…