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

select spot color by name

Explorer ,
Feb 23, 2021 Feb 23, 2021

Copy link to clipboard

Copied

Hi I have rectangles in all kinds of colors and other objects
I want to select only rectangles / shapes whose color contour line is Cutcontour. (Spot color)

TOPICS
Scripting

Views

563

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

correct answers 1 Correct answer

Community Expert , Feb 23, 2021 Feb 23, 2021

Yes, it is possible to select the objects that have CutContour  applied by parsing all pathItems exists in he document. Try following snippet

var doc = app.activeDocument;
var pathItems = doc.pathItems;
var colorName = 'CutContour';
app.executeMenuCommand("deselectall");
for (var j = 0; j < pathItems.length; j++) {
    if (pathItems[j].stroked && pathItems[j].strokeColor.spot && pathItems[j].strokeColor.spot.name == colorName) {
        pathItems[j].selected = true;
    }
}

 

NOTE: Not tested fr

...

Votes

Translate

Translate
Adobe
Community Expert ,
Feb 23, 2021 Feb 23, 2021

Copy link to clipboard

Copied

Could you please post screenshots with the pertinent Panels (Toolbar, Layers, Channels, Options Bar, …) visible? 

Shape Layers cannot have Spot Colors so far, so I am not quite sure how exactly your file is set up at current. 

Votes

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
Explorer ,
Feb 23, 2021 Feb 23, 2021

Copy link to clipboard

Copied

Screen Shot 2021-02-23 at 18.26.40.png

Votes

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
Explorer ,
Feb 23, 2021 Feb 23, 2021

Copy link to clipboard

Copied

Screen Shot 2021-02-23 at 18.28.09.png

Votes

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
Community Expert ,
Feb 23, 2021 Feb 23, 2021

Copy link to clipboard

Copied

I do apaologize, I made a mistake and erroneously thought I was on the Photoshop Forum. 

Votes

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
Community Expert ,
Feb 23, 2021 Feb 23, 2021

Copy link to clipboard

Copied

LATEST

@c.pfaffenbichler 

Lots of work 🙂

Best regards

Votes

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
Community Expert ,
Feb 23, 2021 Feb 23, 2021

Copy link to clipboard

Copied

Hi,

You can use following commands to select

 

app.executeMenuCommand('Find Stroke Color menu item'); // select only objects with same stroke
app.executeMenuCommand('Find Fill Color menu item') // select only objects with same fill
app.executeMenuCommand('Find Fill & Stroke menu item') // select only objects with same stroke and same fill

 

 

Before executing these command, make sure to select the spot swatch in swatch panel.

 

 
Best regards

Votes

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
Explorer ,
Feb 23, 2021 Feb 23, 2021

Copy link to clipboard

Copied

Screen Shot 2021-02-23 at 18.37.07.png

there is a problem

Votes

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
Valorous Hero ,
Feb 23, 2021 Feb 23, 2021

Copy link to clipboard

Copied

You can't use 'CutContour', you need to have 

'Find Fill Color menu item'

 

Votes

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
Explorer ,
Feb 23, 2021 Feb 23, 2021

Copy link to clipboard

Copied

So how did he know what color I wanted?

Votes

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
Community Expert ,
Feb 23, 2021 Feb 23, 2021

Copy link to clipboard

Copied

You have to use the command as specified above based on what objects you would like to select. For an example if you want to select the all objects with stroke color CutContour, then select this spot color in swatch panel and execute the following command as it is. No change in the command required.

 

 

app.executeMenuCommand('Find Stroke Color menu item');

 

Best regards

Votes

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
Explorer ,
Feb 23, 2021 Feb 23, 2021

Copy link to clipboard

Copied

Thanks, I understand, it works, but it is not possible to select the contour without selecting the swatches window?

Votes

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
Community Expert ,
Feb 23, 2021 Feb 23, 2021

Copy link to clipboard

Copied

Yes, it is possible to select the objects that have CutContour  applied by parsing all pathItems exists in he document. Try following snippet

var doc = app.activeDocument;
var pathItems = doc.pathItems;
var colorName = 'CutContour';
app.executeMenuCommand("deselectall");
for (var j = 0; j < pathItems.length; j++) {
    if (pathItems[j].stroked && pathItems[j].strokeColor.spot && pathItems[j].strokeColor.spot.name == colorName) {
        pathItems[j].selected = true;
    }
}

 

NOTE: Not tested from my side but it should work.

Best regards

Votes

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
Explorer ,
Feb 23, 2021 Feb 23, 2021

Copy link to clipboard

Copied

Thanks!!!

Votes

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