Skip to main content
Inspiring
January 19, 2022
Answered

How to find two points shapes with no outline but filled with a color?

  • January 19, 2022
  • 3 replies
  • 954 views

There can be some two points shapes in file which have fill and do not have stroke (outline). It is a tiny lines which hardly visible as well as hard to detect if they are placed on edges of other objects. How to find such shapes? For example, a shape when someone used Line Segment Tool with applied fill and no stroke.

This topic has been closed for replies.
Correct answer femkeblanco

I don't know if I understand you correctly.  This will select paths with two points, a fill and no stroke. 

app.selection = null;
var paths = app.activeDocument.pathItems;
for (var i = 0; i < paths.length; i++) {
    if (paths[i].pathPoints.length == 2
        && paths[i].filled == true
        && paths[i].stroked == false) {
        paths[i].selected = true;
    }
}

3 replies

Met1
Legend
January 19, 2022

If they all the same unique color, find one, then use select → same fill...

Can't be that easy though right?

Inspiring
January 19, 2022

not shure, there can be a lot of objects with the same color and you may do not know where to find such shapes

rcraighead
Legend
January 19, 2022

"Find same appearance" does not limit selection to "2-point" shapes. The script @femkeblanco shared DOES!

femkeblanco
femkeblancoCorrect answer
Legend
January 19, 2022

I don't know if I understand you correctly.  This will select paths with two points, a fill and no stroke. 

app.selection = null;
var paths = app.activeDocument.pathItems;
for (var i = 0; i < paths.length; i++) {
    if (paths[i].pathPoints.length == 2
        && paths[i].filled == true
        && paths[i].stroked == false) {
        paths[i].selected = true;
    }
}
Inspiring
January 19, 2022

you understood perfectly
will those lines be printable (visible) when sending such a file to a postscript imagesetter?

femkeblanco
Legend
January 19, 2022

I don't know the answer, but once selected, can they not be deleted or made invisible? 

Ton Frederiks
Community Expert
Community Expert
January 19, 2022

Object > Path > Clean Up...?

Inspiring
January 19, 2022

nope