Skip to main content
Known Participant
June 17, 2020

P: Toggle between layer mask and layer

  • June 17, 2020
  • 13 replies
  • 12285 views

Hello,

After updating to Photoshop 21.2.0 (June 2020 release), on a Mac, running 10.14.6, I've encountered a bug toggling between a layer mask and its layer using keyboard shortcuts (Command + \ and Command + ~).

After clicking CMD + \ , I am taken to the layer mask, as per usual, but, now it also goes into overlay mode. I have to click \ to get out of overlay mode.

This happens on all three Macs, I've used, all on 10.14.6.

Thanks, in advance, for checking into this.

This topic has been closed for replies.

13 replies

alllanAuthor
Known Participant
May 11, 2022

@Stephen Marsh, thank you for that detailed instruction on the scripts! You are correct, I wasn't feeling the bleeding pain to take this route. But, it's helpful to know.

And, as of version 23.3.2, the problem looks to be corrected, for me. Thanks, @Mohit Goyal .

Mohit Goyal
Community Manager
Community Manager
May 11, 2022

Hi there,

 

We're happy to announce the release of Photoshop 23.3.2. This update includes the fix for this issue. To see the list of all fixed issues, click here

 

To update Photoshop to 23.3.2, click "Update" in the Creative Cloud desktop app next to Photoshop. More detailed instructions for updating  

 

Let us know if the update resolves the problem for those affected and share your feedback with us.  

 

Thanks,

Mohit

Stephen Marsh
Community Expert
Community Expert
May 2, 2022

@alllan – no worries, just let me know if you wish to explore this workaround. It can be hard to use new keyboard shortcuts due to muscle memory, so you would need to really be feeling the pain to go down this path...

 

Edit: Better to post the scripts than not, just in case it helps somebody in the future...

 

Select the active layer mask channel:

 

selectLayerCompositeChannel("mask");

function selectLayerCompositeChannel(chanPara) {
    // "RGB" | "mask"
	var s2t = function (s) {
		return app.stringIDToTypeID(s);
	};
	var descriptor = new ActionDescriptor();
	var reference = new ActionReference();
	reference.putEnumerated( s2t( "channel" ), s2t( "channel" ), s2t( chanPara ));
	descriptor.putReference( s2t( "null" ), reference );
	descriptor.putBoolean( s2t( "makeVisible" ), false );
	executeAction(s2t( "select" ), descriptor, DialogModes.NO);
}

 

 

Select the active layer composite channel:

 

selectLayerCompositeChannel("RGB");

function selectLayerCompositeChannel(chanPara) {
    // "RGB" | "mask"
	var s2t = function (s) {
		return app.stringIDToTypeID(s);
	};
	var descriptor = new ActionDescriptor();
	var reference = new ActionReference();
	reference.putEnumerated( s2t( "channel" ), s2t( "channel" ), s2t( chanPara ));
	descriptor.putReference( s2t( "null" ), reference );
	descriptor.putBoolean( s2t( "makeVisible" ), false );
	executeAction(s2t( "select" ), descriptor, DialogModes.NO);
}

 

 

Toggle between selected composite and mask channels:

 

/* 
Based on a script by jazz-y
https://community.adobe.com/t5/photoshop-ecosystem-discussions/detect-if-mask-or-layer-is-selected-with-js-script/m-p/11153109
*/

s2t = stringIDToTypeID;

(r = new ActionReference()).putProperty(s2t('property'), p = s2t('hasUserMask'));
r.putEnumerated(s2t("layer"), s2t("ordinal"), s2t("targetEnum"));
if (executeActionGet(r).getBoolean(p)) {
    (r = new ActionReference()).putProperty(s2t('property'), p = s2t('name'));
    (r = new ActionReference()).putEnumerated(s2t("layer"), s2t("ordinal"), s2t("targetEnum"));
    layerName = executeActionGet(r).getString(p);

    (r = new ActionReference()).putProperty(s2t('property'), p = s2t('channelName'));
    r.putEnumerated(s2t("channel"), s2t("ordinal"), s2t("targetEnum"));
    channelName = executeActionGet(r).getString(p);

    (r = new ActionReference()).putProperty(s2t('property'), p = s2t('alphaChannelOptions'));
    r.putEnumerated(s2t("channel"), s2t("ordinal"), s2t("targetEnum"));
    alphaChannel = executeActionGet(r).hasKey(p)

    if (channelName.indexOf(layerName) == 0 && !alphaChannel) {
        // var select = confirm('Layer mask selected\nSelect layer?') ? 'RGB' : null
        var select = 'RGB';
    } else {
        // var select = confirm('Layer selecter\nSelect mask?') ? 'mask' : null
        var select = 'mask';
    }
    if (select) {
        (r = new ActionReference()).putEnumerated(s2t("channel"), s2t("channel"), s2t(select));
        (d = new ActionDescriptor).putReference(s2t("null"), r);
        executeAction(s2t("select"), d, DialogModes.NO);
    }
}

 

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

alllanAuthor
Known Participant
May 2, 2022

Thank you, @Stephen Marsh, for that suggestion.

Stephen Marsh
Community Expert
Community Expert
April 30, 2022

@alllan – In the short term, a script could be used with a custom keyboard shortcut.

Legend
April 30, 2022

Looks like the change wasn't pushed to the release version of Photoshop. The fix for this will be in an forthcoming update.

alllanAuthor
Known Participant
April 22, 2022

Hello,

The problem still exists, for me, I'm on a MAC, using OS 12.3.1, and Photoshop 23.3.1.

Inspiring
October 25, 2020

The problem is still there in the newly released Photoshop 22, windows 10.

Could you please at least keep what's already working??

Earth Oliver
Legend
June 27, 2020
can confirm on win10 too.
alllanAuthor
Known Participant
June 26, 2020
Jeffrey,

Here is a screen recording of the problem.

Thanks.

https://www.youtube.com/watch?v=rwext35lZOE&feature=youtu.be