The layers and layerSets arrays sometimes do not contain certain groups
I was assuming that the layers array always contains all art layers and all layer sets (groups) we see in photoshop. Similarly, layerSets contains all layer sets.
However, I found a case where this does not occur. More specifically, some groups are not included in the layers and layerSets arrays. I know this because I'm iterating through layer.layers or layer.layerSets in a for loop and these groups never show up.
When I make these problematic groups visible in photoshop or I select them, I don't see the usual bounding box we see for other layers/groups, which I think shows up when there are visible pixels. I suspect this is related to the issue.
At the same time, in my script, at some point, I also try to remove these groups and they actually show up and they are removed. So, maybe the order of the operations or something else is also affecting this.
Just to be clear, I see the groups and their layers in photoshop.
Do you know what could actually be causing some groups not to be included in layers or layerSets?
I'm using an ExtendScript script.
Photoshop version: 26.9.0
Scripting version: 26.9
