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)
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
...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.
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
I do apaologize, I made a mistake and erroneously thought I was on the Photoshop Forum.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
there is a problem
Copy link to clipboard
Copied
You can't use 'CutContour', you need to have
'Find Fill Color menu item'
Copy link to clipboard
Copied
So how did he know what color I wanted?
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');
Copy link to clipboard
Copied
Thanks, I understand, it works, but it is not possible to select the contour without selecting the swatches window?
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.
Copy link to clipboard
Copied
Thanks!!!