• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Is it possible to remove() or delete a brush using a script?

Explorer ,
Feb 08, 2020 Feb 08, 2020

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?

 

 

TOPICS
Scripting , SDK , Tools

Views

775

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
LEGEND ,
Feb 08, 2020 Feb 08, 2020

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 08, 2020 Feb 08, 2020

Copy link to clipboard

Copied

Is it possible to write an action to delete a specific brush by name? Or perhaps by index? 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Mar 02, 2020 Mar 02, 2020

Copy link to clipboard

Copied

LATEST

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines