Copy link to clipboard
Copied
I have a rectangle with a green fill and a crimson stroke, to which I have applied some effects and added a blue stroke.
With this script I am trying to do an Expand Appearance and then Expand - to get rid of all Appearence and convert all the stroke to fills. I want to end up with an object consisting of only fills. However, the 'expand' command doesn't seem to work as I end up with an object consisting of only stroked paths.
function expandAppearanceAndStroke(item) {
try {
item.selected = true;
app.executeMenuCommand('expandStyle');
app.executeMenuCommand('expand');
} catch (e) {
// nothing to do
}
}
Perhaps this is done in some other way?
Wrong command name in your code
app.executeMenuCommand('Expand3'); // Show native menu Expand
Create and use "Expand" action, not via executeMenuCommand() https://community.adobe.com/t5/illustrator-discussions/is-it-possible-to-quot-expand-quot-using-script-without-display-the-option-dialog/td-p/11167917
Copy link to clipboard
Copied
Wrong command name in your code
app.executeMenuCommand('Expand3'); // Show native menu Expand
Copy link to clipboard
Copied
@Sergey Osokin is there a way to auto submit the menu dialog?
Copy link to clipboard
Copied
Create and use "Expand" action, not via executeMenuCommand() https://community.adobe.com/t5/illustrator-discussions/is-it-possible-to-quot-expand-quot-using-scri...
Find more inspiration, events, and resources on the new Adobe Community
Explore Now