Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Shortcut-key to set color label on one or multiple layers at once

Participant ,
Jul 26, 2024 Jul 26, 2024

Hello, does anyone have a way to create a shortcut key for setting a color label on one or multiple layers at once?

TOPICS
macOS
615
Translate
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 , Jul 27, 2024 Jul 27, 2024

@Omineus 

 

You can only have the hard-coded colours, not custom colours.

 

2024-07-27_20-51-01.png

 

/*
Prior to version 2024: "none","red","orange","yellowColor","grain","blue","violet","gray" 
New in version 2024: "magenta", "seafoam", "indigo", "fuchsia"
Adding an unsupported name is possible to return "black".
Install this script in the Application folder Presets/Scripts and restart Photoshop.
Assign a custom keyboard shortcut via Edit > Keyboard Shortcuts > File > Scripts
*/

// Set the label color
setLayerLabel
...
Translate
Adobe
Community Expert ,
Jul 26, 2024 Jul 26, 2024

It isn't a keyboard shortcut, but you can apply a color label to more than one layer at a time. You can Shift + select the layers that you'd like to label with a color, right-click, and in the contextual menu that opens, select Color and then whichever color you want to apply.

Translate
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
Participant ,
Jul 27, 2024 Jul 27, 2024

Thanks for your answer. When your trying to stay organized without layer names and still keep the tempo. This method does not work.

Translate
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
Community Expert ,
Jul 26, 2024 Jul 26, 2024

@Omineus â€“ This can be scripted and a custom keyboard shortcut applied to the script. Even an action could do it if you were happy with an F-key shortcut.

 

As there are 11-12 possible colours, this could be a bit convoluted with separate scripts for each colour.

 

Another option would be to take the extra effort to add a GUI to pick the colour and then one would only need a single script (but would this really be any better than Myra's suggestion of using the standard native feature?).

 

Translate
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
Participant ,
Jul 27, 2024 Jul 27, 2024

Thanks for your quick and comprehensive message. Would it be possible for just these 5 colors? Can I change the shortcut keys and colors afterwards?

Translate
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
Community Expert ,
Jul 27, 2024 Jul 27, 2024

@Omineus 

 

You can only have the hard-coded colours, not custom colours.

 

2024-07-27_20-51-01.png

 

/*
Prior to version 2024: "none","red","orange","yellowColor","grain","blue","violet","gray" 
New in version 2024: "magenta", "seafoam", "indigo", "fuchsia"
Adding an unsupported name is possible to return "black".
Install this script in the Application folder Presets/Scripts and restart Photoshop.
Assign a custom keyboard shortcut via Edit > Keyboard Shortcuts > File > Scripts
*/

// Set the label color
setLayerLabelCol("grain");

function setLayerLabelCol(labelCol) {
    var c2t = function (s) {
        return app.charIDToTypeID(s);
    };
    var s2t = function (s) {
        return app.stringIDToTypeID(s);
    };
    var descriptor = new ActionDescriptor();
    var descriptor2 = new ActionDescriptor();
    var reference = new ActionReference();
    reference.putEnumerated(s2t("layer"), s2t("ordinal"), s2t("targetEnum"));
    descriptor.putReference(c2t("null"), reference);
    descriptor2.putEnumerated(s2t("color"), s2t("color"), s2t(labelCol));
    descriptor.putObject(s2t("to"), s2t("layer"), descriptor2);
    executeAction(s2t("set"), descriptor, DialogModes.NO);
}

 

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

 

Translate
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
Participant ,
Jul 27, 2024 Jul 27, 2024
LATEST

Very clear. Understood! 

Thank you very much!

Translate
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