Skip to main content
StrongBeaver
Legend
March 12, 2017
Answered

Path with fill

  • March 12, 2017
  • 1 reply
  • 2052 views

PathItems doesn't have the method to find if a path has a fill, which is what I must know ?

This topic has been closed for replies.
Correct answer pixxxelschubser

Must I know the color of a path fill to apply noColor ?

app.activeDocument.fillColor = noColor;


Yes. There is never a activeDocument[0]

(like I wrote before)

And last answer by myself:

curDoc.selection[0].filled = false;

or

curDoc.pathItems[0].filled = false;

All of these is a part of basic knowledgebase and you can find hundreds of examples here in forum.

1 reply

Silly-V
Legend
March 12, 2017

Yea they do, where do you go to to find these properties? You can see them in the ESTK OMV. The property is "filled".

StrongBeaver
Legend
March 12, 2017

I look in the Javascript ref guide (pdf) is it not listed in this guide ? I think it's defaultFilled;

app.document.defaultfilled = true;

Inspiring
March 12, 2017

Since each path can have its own fill you need to check the "filled" property of the individual path items.

if( app.activeDocument.pathItems[0].filled )

    alert( "the path has a fill applied!" )

You can then get to the actual fill color by using the "fillColor" property. Same thing for strokes, just change it to "stroked" and "StrokeColor"

In the reference guide, look under the PathItem header.

Good luck!