Copy link to clipboard
Copied
Hi,
I want to check any pathIem has brushes Applied or not. Can you please provide me the script for the same
Copy link to clipboard
Copied
As far as I know, in Illustrator scripts we can apply a brush to an path, but we can't check if the brush has been applied to the path. Maybe someone found a solution.
Copy link to clipboard
Copied
Sorry for this long story: I wrote a function that determines if a dashed stroke has "align to ends and corners" set. This isn't exposed to the scripting API, so I had to do a hack: the script duplicates the item, alter the path points so that there are only two path points, a specific distance apart, sets a specific stroke weight and dash pattern and expands the stroke, then checks how many path items are made—if two then not aligned; if three, then aligned.
Your case *might* be amenable to solving in a similar way: by expanding a duplicate, simplifying the points of the path, outlining the stroke, and measuring the number of pathPoints created against a known value. There would be a bit of experimentation required to make this work (if it even will) because you will have to test with different brushes to see if you get false positives. Anyway, just a thought. Like @Sergey Osokin, I don't know any easy way.
- Mark