Change every layer's visibility in group

What I’m trying to do is make every layer of a group either visible or hidden. Currently when you toggle the visibility of a group it doesn’t affect the individual layers, only the group. What I’m ultimately trying to do is if I have every layer of a group visible and I want to edit one layer by itself, I’ll have to make every other layer hidden, edit, then make every other layer visible again. Having many layers can make that quite tedious.

hi tmdemd! yes, working with groups can be tricky, but luckily for us we can use scripts.
following will hide or show every layer in group:

local sel = app.layer 
local visibility = sel.isVisible 
sel.isVisible = not visibility 

if sel.isGroup then 
	for i, layer in ipairs(sel.layers) do 
		local visible = layer.isVisible
		if visible == visibility then 
			layer.isVisible = not visibility 
		end 
	end
end

for convenience i recomment to set the keyboard shortcut to run the script.
hope it helps.

PS.: the script is super simple, so it will work only on single selected group. also note that the script is NOT recursive, meanig the visibility of any group nested in parent group will be set accordingly, but the layers inside will keep their visibility setting (default aseprite behaviour).

this also means that any already hidden layers inside the group will be eventually switched on. if you need quick clean up of layer stack, you can use this script.