In Photoshop CC2022, I would like to toggle the visibility of an adjustment layer with a key.

New Here ,
Aug 20, 2022 Aug 20, 2022

Copy link to clipboard

Copied

Right now I'm using Actions. One action hides the layer by name. The other shows it. It is almost perfect, the only problem is that it uses 2 different keys, which is a bit confusing and wastes the few keys that are available.

 

Thank you for reading. I hope someone helps me with this, I use this all the time.

TOPICS
Actions and scripting , Windows

Views

54

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Aug 20, 2022 Aug 20, 2022

Change the name of "theLayer" to your adjustment layer name (layer name should be unique not multiples of the same name). This is only for top-level/root layers, not layers nested inside groups.

 

Based on a script from @Chuck Uebele 

 

#target photoshop
var toggleLayer = activeDocument.layers.getByName("theLayer");
toggleLayer.visible = toggleLayer.visible === false;

 

or

 

#target photoshop
var toggleLayer = activeDocument.layers.getByName("theLayer");
toggleLayer.visible = !toggleLayer.visibl
...

Likes

Translate

Translate
Community Expert ,
Aug 20, 2022 Aug 20, 2022

Copy link to clipboard

Copied

LATEST

Change the name of "theLayer" to your adjustment layer name (layer name should be unique not multiples of the same name). This is only for top-level/root layers, not layers nested inside groups.

 

Based on a script from @Chuck Uebele 

 

#target photoshop
var toggleLayer = activeDocument.layers.getByName("theLayer");
toggleLayer.visible = toggleLayer.visible === false;

 

or

 

#target photoshop
var toggleLayer = activeDocument.layers.getByName("theLayer");
toggleLayer.visible = !toggleLayer.visible;

 

  1. Copy the code text to the clipboard
  2. Open a new blank file in a plain-text editor (not in a word processor)
  3. Paste the code in
  4. Save the text file as .txt
  5. Rename the file extension from .txt to .jsx
  6. Install, then assign a custom keyboard shortcut to the script:

https://prepression.blogspot.com/2017/11/downloading-and-installing-adobe-scripts.html#Photoshop

 

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines