Copy link to clipboard
Copied
Hi all,
I've tried using app.activeDocument.brushes[1].remove(); to remove a brush from the active document but it says that it is not a function. app.activeDocument.brushes[1].name etc. works fine.
When I try the same thing for swatches and symbols it works perfectly. If remove() isn't available for brushes is there another method that I could use to remove or delete a brush from the active document?
Copy link to clipboard
Copied
I haven't been able to make it work either. You can write an Action to "delete all unused brushes" if that would help. Maybe a scripting guru is lurking.
Copy link to clipboard
Copied
Is it possible to write an action to delete a specific brush by name? Or perhaps by index?
Copy link to clipboard
Copied
I believe actions are the only way to delete unused brushes, and even then they don't always get all the brushes even if there are no strokes used within a document, no patterns, graphic styles, symbols etc. As documented by the "Delete Fluff" script on http://www.wundes.com/JS4AI/ you can see brushes but you cannot delete them. A good indicator of this as well is Astute Graphics plugin "Vector First Aid" which eliminates unused graphic styles, symbols and swatches in record time, but cannot touch the brushes at all. Not sure why these are untouchable, but at the very least you can action remove to eliminate most. I think the only surefire way to script removing anything may be to actually copy your art into a new blank file, having already expanded and deleted any unwanted elements.