Skip to main content
Participant
August 20, 2022
해결됨

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

  • August 20, 2022
  • 1 답변
  • 194 조회

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.

이 주제는 답변이 닫혔습니다.
최고의 답변: Stephen Marsh

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

 

1 답변

Stephen Marsh
Community Expert
Community Expert
August 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.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