What's new
Photoshop Gurus Forum

Welcome to Photoshop Gurus forum. Register a free account today to become a member! It's completely free. Once signed in, you'll enjoy an ad-free experience and be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Is this possible? Layer toggle with a twist?


GPS

Member
Messages
19
Likes
0
Hi,

As a beginning PS painter, I am looking for a script or action that will toggle the top layer visibility on/off, and when it toggles off, return me to the later I started from.

If it makes it simpler, this could be the layer right below the top layer.

This would all be done with the push of a single key.

Thanks in advance if this is possible!
 
If you want to view the original layer hold the alt key on pc or option on mac and click the eye icon on the layer that you want to view. When finished just click it again while holding the alt/option key to view all the layer that were previously visible. I think this will get you the result you desire, but I'm not entirely sure what your asking.
 
Last edited:
Hi Stric,

That's a nice tip (thanks), but it doesn't get me what I am after: If I have to move my hand all the way over to the layers tab every time I want to turn on and off the layer, I may as well just use the eye icon for the top layer without alt.

What I am after is a way to have an overlay of sorts appear and disappear at will as I lay down paint strokes. I don't want to have to move my pen off what I am painting while I am turning the layer on and off - instead, with my left hand, I want to do this with a keyboard shortcut.

I hope that makes the question clearer.
 
Last edited:
This might be what you are after....
Code:
activeDocument.layers[0].visible = !activeDocument.layers[0].visible;
 
Hello Paul,

That looks quite logical. Unfortunately for me, I have not a clue how to get that script (or any script) into Photoshop.
Could you please educate me on how I can make that show up (and connect it to a key - say F2) in Photoshop CS5?

Many thanks, and sorry for the newbie question.
 
Copy and paste the code into ExtendScript Toolkit.
This utility can be found:-
PC: C:\Program Files\Adobe\Adobe Utilities
MAC: <hard drive>/Applications/Utilities/Adobe Utilities
Save the script to the following folder:-
PC: C:\Program Files\Adobe\Adobe Photoshop CS5\Presets\Scripts
MAC: <hard drive>/Applications/Adobe Photoshop CS5/Presets/Scripts
N.B. if your are using Vista or Windows 7 you will need to save the script elsewhere and then copy it to the relevant folder, this is due to permissions.
If Photoshop was open close and restart it so that it can pick up the new script.
To assign an action and function key, start recording a new action, assign the function key you require, then from the action palette fly-out menu select "Insert Menu Item" now File - Scripts and select your new script. Stop the recording.
Now every time you press the function key it will run the script.
Hope this helps.
 
Awesome Paul! I am indebted to you.

I will try this as soon as I get a chance (duties call at the moment) and post back.
 
Thank you again, it worked! A few notes:

My toolkit is in: C:\Program Files (x86)\Adobe\Adobe Utilities - CS5\ExtendScript Toolkit CS5

My scripts were in: C:\Users\<my name>\Documents\Adobe Scripts

And - I had to delete the line about Insert Menu Item, leaving your script which I pointed to from the file menu. (Had an error with it in).

Anyway, awesome fast answers! Thanks so much!:)
 

Back
Top