Skip to main content
Inspiring
November 15, 2023
Question

Null visibility with no parent layer

  • November 15, 2023
  • 1 reply
  • 204 views

I can check to see if a parent (group) of a Photoshop layer is visible or not with:

 

if (theParent.visible == false)
{
  // do something? Like switch it on?
  theParent.visible = true;
}

 

And you can find the name of that parent group with 

alert(theParent.name); // Group 1

 

If it's a layer that's just on it's own the parent name will be the name of the document.

Err ok.  

And parent.visible will be null. 

 

Can it be safe to assume if if the parent === null it's an "orphan layer" or is there a better way of determining that?

 

- Got you all thinking now 😄

 

This topic has been closed for replies.

1 reply

jane-e
Community Expert
Community Expert
November 15, 2023

@Ghoul Fool 

 

I've moved your post from the Developers forum to Photoshop > Scripting

 

Jane