Copy link to clipboard
Copied
I would like to add a keyboard shorcut that does exactly what the button at the bottom of the layer panel does. That is to Reveal All or Reveal Selected depending if something is selected.
I know I can set a shortcut for "reveal all" and then have to create another for "reveal selected" but a single shortcut to do what the button in the panel does would help keep the flow.
Thank you
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Sorry, I misunderstood the question…
Copy link to clipboard
Copied
I agree with JJMack, simply create an action set and add a separate action for each...
Hold down option/alt key when recording the hide step. Or simply use the insert menu command to insert each menu item rather than recording.
You can then assign a keyboard F-key shortcut to each action by double-clicking each action and assigning the function key and or keyboard modifier. EDIT: See the new post below for a visual.
All that being said, function key shortcuts are not that great.
With a bit more work, it is possible to use "regular" custom keyboard shortcuts for loaded actions that are not installed, an indirect method is by running an action from a script from a custom keyboard shortcut assigned to the script: https://prepression.blogspot.com/2016/11/photoshop-scripting-actions.html
This could also be scripted which would allow direct access to custom keyboard shortcuts without calling an action.
Copy link to clipboard
Copied
Hide:
layerMaskFromSelection("hideSelection");
function layerMaskFromSelection(hideORreveal) {
var idmake = stringIDToTypeID("make");
var desc1091 = new ActionDescriptor();
var idnew = stringIDToTypeID("new");
var idchannel = stringIDToTypeID("channel");
desc1091.putClass(idnew, idchannel);
var idat = stringIDToTypeID("at");
var ref59 = new ActionReference();
var idchannel = stringIDToTypeID("channel");
var idchannel = stringIDToTypeID("channel");
var idmask = stringIDToTypeID("mask");
ref59.putEnumerated(idchannel, idchannel, idmask);
desc1091.putReference(idat, ref59);
var idusing = stringIDToTypeID("using");
var iduserMaskEnabled = stringIDToTypeID("userMaskEnabled");
// "hideSelection" or "revealSelection"
var idrevealSelection = stringIDToTypeID(hideORreveal);
desc1091.putEnumerated(idusing, iduserMaskEnabled, idrevealSelection);
executeAction(idmake, desc1091, DialogModes.NO);
}
Reveal:
layerMaskFromSelection("revealSelection");
function layerMaskFromSelection(hideORreveal) {
var idmake = stringIDToTypeID("make");
var desc1091 = new ActionDescriptor();
var idnew = stringIDToTypeID("new");
var idchannel = stringIDToTypeID("channel");
desc1091.putClass(idnew, idchannel);
var idat = stringIDToTypeID("at");
var ref59 = new ActionReference();
var idchannel = stringIDToTypeID("channel");
var idchannel = stringIDToTypeID("channel");
var idmask = stringIDToTypeID("mask");
ref59.putEnumerated(idchannel, idchannel, idmask);
desc1091.putReference(idat, ref59);
var idusing = stringIDToTypeID("using");
var iduserMaskEnabled = stringIDToTypeID("userMaskEnabled");
// "hideSelection" or "revealSelection"
var idrevealSelection = stringIDToTypeID(hideORreveal);
desc1091.putEnumerated(idusing, iduserMaskEnabled, idrevealSelection);
executeAction(idmake, desc1091, DialogModes.NO);
}
https://prepression.blogspot.com/2017/11/downloading-and-installing-adobe-scripts.html
Copy link to clipboard
Copied
A Conditional added to an action set that has both the Reveal All and Reveal Selection actions may work.
https://helpx.adobe.com/photoshop/using/conditional-actions-creative-cloud.html
After you record, name and put the two layer mask actions into a set, use Insert Conditional put the
Conditional action as the first action in the set.
Then in the Conditional dialog set If Current to Document Has a Selection, set Then Play Action to
Reveal Selection and set Else Play Action to Reveal All
You can then assign a Function Key to the Conditional Action step
conditional action played on image with selection
conditional action played on image with no selection
Copy link to clipboard
Copied
Excellent solution.
Copy link to clipboard
Copied
Yes you can do that with three actions in an action set or a single Photoshop script. or just use Photoshop Layers palette add Layer Mask button which has both capabilities plus it can add the inverse Layer Masks the Hide All or Hide selection the Button with a modifier key. I use the Layers Palette button.
Copy link to clipboard
Copied
Are @Stephen_A_Marsh and @Jeff Arola the same person using different user names? 😉
They have both been putting up a lot of excellent answers since I started posting again.
Copy link to clipboard
Copied
Haha!
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Thank you and NO.
I was hoping I had missed something in the "Keyboard Shortcuts and Menu" Dialog that would allow me to easily add this. It seemed to be a simple request since the action already exists on the interface.
Copy link to clipboard
Copied
Is not adding a shortcut F key to an action that perform the function you want not adding a shortcut to the function you want to use.
The UI interface button is more functional for the button has four functions when you add in selections and modifier keys.
Copy link to clipboard
Copied
@Bando wrote:
Thank you and NO.
I was hoping I had missed something in the "Keyboard Shortcuts and Menu" Dialog that would allow me to easily add this. It seemed to be a simple request since the action already exists on the interface.
Sometimes in Photoshop, things are not as simple or initially obvious as one may wish or hope for them to be. You were provided multiple options that will give you the ability to set the shortcuts that you are looking for. All you need to do is just pick at least one of the options provided and set it up.
I provided screenshots of a couple of actions, with instructions on how to record the actions. You can then set a F key shortcut directly on each action. EDIT: See below for visual instructions.
I also provided two JavaScripts and a link explaining how to save them and install them so that you can also assign a custom keyboard shortcut to the scripts to add the functionality from the GUI in a keyboard shortcut.
Step by step instructions can be provided if the general information previously provided needs further explanation.
Copy link to clipboard
Copied
Option 1: Function Key with modifier
Option 2: Assign keyboard shortcut to script
Copy link to clipboard
Copied
Where are we at now?
I believe that there have been multiple correct answers which will allow you to set a keyboard shortcut to apply a hide or reveal layer mask (whether based on selection or not).
Please add likes and or correct answers to the various posts so that when others are searching for a resolution to their issue it will be obvious that a solution was found.