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

Colour tag / search Layer comps - Photoshop

Community Beginner ,
Mar 08, 2023 Mar 08, 2023

Copy link to clipboard

Copied

I have files for clients, which contain tons of variations of an image, artowkr layer, colour variations etc

Searcing through 70 layer comps is painful and boring.

 

The ability to better organise layer comps with colour labels, folders, search fields etc .. as per the action and layers panels would be great!

 

Idea No status
TOPICS
Actions and scripting , iPadOS , macOS , SDK

Views

185

Translate

Translate

Report

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
5 Comments
Community Expert ,
Mar 08, 2023 Mar 08, 2023

Copy link to clipboard

Copied

I have voted. Perhaps a script could do something, I'll take a look for you tomorrow.

Votes

Translate

Translate

Report

Report
Community Expert ,
Mar 08, 2023 Mar 08, 2023

Copy link to clipboard

Copied

Looking at the scripting properties and methods, there sadly doesn't appear to be much that can be done (by me)... It might be possible to search for a keyword in the comp name though, I'll see what I can come up with.

 

Of course, it is possible to create GUI-based scripts, extensions or UXP paenels etc. for extra functionality beyond the native panel.

Votes

Translate

Translate

Report

Report
Community Expert ,
Mar 08, 2023 Mar 08, 2023

Copy link to clipboard

Copied

OK, here is a script that will let you search for a layer comp with a case-sensitive, partial or full name match:

 

comp2.png

 

EDIT: Script updated to 1.1 version!

 

/*
Find Layer Comp By Name Prompt.jsx
v1.1, 9th March 2023, Stephen Marsh
https://community.adobe.com/t5/photoshop-ecosystem-ideas/colour-tag-search-layer-comps-photoshop/idc-p/13636551
*/

#target photoshop

    (function () {

        var doc = activeDocument;

        // Prompt for the comp name
        layerCompName = prompt("Find Layer Comp By Name: \r (Case Sensitive, Full or Partial Match Required)", "");
        if (layerCompName === null) {
            //alert('Script cancelled!');
            return
        }

        // Check if the current document has any layer comps
        if (doc.layerComps.length === 0) {
            alert("The doc doesn't have any layer comps!");
        } else {
            var layerComp = null;

            // Loop over all the layer comps and search for the name entered into the prompt
            for (var i = 0; i < doc.layerComps.length; i++) {
                // Full case sensitive match on name
                //if (doc.layerComps[i].name === layerCompName) {
                // Partial or full case sensitive match on name
                if (doc.layerComps[i].name.indexOf(layerCompName) !== -1) {
                    layerComp = doc.layerComps[i];
                    break;
                }
            }

            // Check if a layer comp with the entered name was found
            if (layerComp === null) {
                alert("No layer comp with the name '" + layerCompName + "' was found.");
            } else {
                layerComp.apply();
                alert("Layer comp name '" + layerCompName + "' found and selected!");
            }
        }

    })();

 

  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 as a plain text format file – .txt
  5. Rename the saved file extension from .txt to .jsx
  6. Install or browse to the .jsx file to run (see below)

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

Votes

Translate

Translate

Report

Report
Community Expert ,
Mar 08, 2023 Mar 08, 2023

Copy link to clipboard

Copied

The following variation on the previous script will search for a case-sensitive, full or partial matching comment (rather than name):

 

EDIT: Script updated to 1.1 version!

 

/*
Find Layer Comp By Comment Prompt.jsx
v1.1, 9th March 2023, Stephen Marsh
https://community.adobe.com/t5/photoshop-ecosystem-ideas/colour-tag-search-layer-comps-photoshop/idc-p/13636551
*/

#target photoshop

    (function () {

        var doc = activeDocument;

        // Prompt for the comp comment
        layerCompComment = prompt("Find Layer Comp By Comment: \r (Case Sensitive, Full or Partial Match Required)", "");
        if (layerCompComment === null) {
            //alert('Script cancelled!');
            return
        }

        // Check if the current document has any layer comps
        if (doc.layerComps.length === 0) {
            alert("The doc doesn't have any layer comps!");
        } else {
            var layerComp = null;

            // Loop over all the layer comps and search for the comment entered into the prompt
            for (var i = 0; i < doc.layerComps.length; i++) {
                // Full case sensitive match on comment
                //if (doc.layerComps[i].comment === layerCompComment) {
                // Partial or full case sensitive match on name
                if (doc.layerComps[i].comment.indexOf(layerCompComment) !== -1) {
                    layerComp = doc.layerComps[i];
                    break;
                }
            }

            // Check if a layer comp with the entered comment was found
            if (layerComp === null) {
                alert("No layer comp with the comment '" + layerCompComment + "' was found.");
            } else {
                layerComp.apply();
                alert("Layer comp comment '" + layerCompComment + "' found and selected!");
            }
        }

    })();

 

 

Votes

Translate

Translate

Report

Report
Community Expert ,
Mar 08, 2023 Mar 08, 2023

Copy link to clipboard

Copied

LATEST

I'm still trying to work out how to make the search case-insensitive or partial matching (there would of course be limitations if a full or partial match occurs for two or more entries).

 

EDIT: If required, I have only been able to make the search case insensitive by converting the string to lowercase (or uppercase, which makes less sense as it takes more work). Both scripts have been updated to include full or partial matching.

 

@Ian26310128ux30 – Please let me know how you go!

Votes

Translate

Translate

Report

Report