vitkovalcik's profile

54 Messages

 • 

1.1K Points

Fri, May 29, 2020 8:23 AM

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

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 :(


Responses

959 Messages

 • 

15.3K Points

1 y ago

Are you familiar with the Action Manager code? It is more low level. DOM is based on that.

54 Messages

 • 

1.1K Points

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 :/

959 Messages

 • 

15.3K Points

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?

54 Messages

 • 

1.1K Points

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.

959 Messages

 • 

15.3K Points

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.