How to "unapply" (ie, remove) a brush from a page item in javascript/extendscript
Copy link to clipboard
Copied
To apply a brush to a page item in javascript, I can do this:
var brush = app.activeDocument.brushes.getByName("My Brush");
brush.applyTo(somePageItem);
But how would I remove a brush from a page item? I don't see any way to do that.
Note I don't want to remove the brush from the brushes palette or from a brush library, I want the page item to no longer have any brush applied. There is always a "Basic" brush in every brush library by default, it seems, but that doesn't seem to be accessable, ie, this gives an error:
var brush = app.activeDocument.brushes.getByName("Basic");
since there really is no brush with that name.
Explore related tutorials & articles
Copy link to clipboard
Copied
app.activeDocument.graphicStyles["[Default]"].applyTo(app.activeDocument.pathItems["yourPathItemName"]);
removes all appearance attributes, including brush.
Copy link to clipboard
Copied
Is that the only way? I also may have effects applied that I do not want to remove, so this method won't work for me.
Copy link to clipboard
Copied
record an Action to Remove Brush Stroke, then have the script play the action
Copy link to clipboard
Copied
Thanks for the idea, I'll give that a try. I was hoping there was a native code method of doing it but I guess that's often not the case with adobe scripting.
Copy link to clipboard
Copied
yeah, using actions is our last hope, not everything is accessible to scripting unfortunately.

