JavaScript "ArtLayer.visible" property - bug/sudden change from previous versions

  • 1
  • Problem
  • Updated 1 month ago
I noticed one of my scripts started doing weird things, because of a change in Photoshop JavaScript processing considering ArtLayer.visibility property for layers in a group. Consider this

Group1 [Visibility checkbox/eye UNCHECKED]
--- Layer1 [Visibility checkbox/eye CHECKED]

Previously (months ago) the "Layer1.visibility" was true exactly when the layer visibility checkbox was checked.

Currently the "Layer1.visibility" is true only if the checkbox is true, BUT ALSO Group1.visibility is true as well. So how to get the true state of the visibility check box now?


I understand the new concept, but my script needs to store states of visibility of all layers and restore them later. Currently, there seems to be no way to detect visibility states for layers in invisible groups :(


Photo of Vít Kovalčík

Vít Kovalčík

  • 26 Posts
  • 6 Reply Likes

Posted 1 month ago

  • 1
Photo of Jaroslav Bereza

Jaroslav Bereza

  • 944 Posts
  • 252 Reply Likes
Are you familiar with the Action Manager code? It is more low level. DOM is based on that.
Photo of Vít Kovalčík

Vít Kovalčík

  • 26 Posts
  • 6 Reply Likes
Thanks! I wasn't aware of that, but it seems that might be a workaround. (For other people searching for the same thing, the closest example I have found so far is here: https://community.adobe.com/t5/photoshop/toggle-layer-visibility/td-p/3222140/page/2 )

I still consider the DOM visibility property to be broken though :/
Photo of Jaroslav Bereza

Jaroslav Bereza

  • 944 Posts
  • 252 Reply Likes
ActionManager code is a legit way to code. It can be much faster but it is more challenging and you need to be sure that you know what you do. Btw do you live in Prague or Brno?
Photo of Vít Kovalčík

Vít Kovalčík

  • 26 Posts
  • 6 Reply Likes
All right, I will give it a shot :)

I am from Brno and btw nice to meet you here - I am also on Nyx as Blackx.
Photo of Jaroslav Bereza

Jaroslav Bereza

  • 944 Posts
  • 252 Reply Likes
I am also from Brno. We can continue this discussion in the pub if you want to :-D
I have an account on Nyx but I am not using it. I never got used to that forum.