Skip to main content
Inspiring
October 25, 2024
Answered

How do I get rid of all the effects and convert all the outlines to paths with fill?

  • October 25, 2024
  • 1 reply
  • 542 views

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?

This topic has been closed for replies.

1 reply

Sergey Osokin
Inspiring
October 28, 2024

Wrong command name in your code

app.executeMenuCommand('Expand3'); // Show native menu Expand

 

Inspiring
October 28, 2024

@Sergey Osokin is there a way to auto submit the menu dialog?

Sergey Osokin
Sergey OsokinCorrect answer
Inspiring
October 28, 2024