How do I get rid of all the effects and convert all the outlines to paths with fill?
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?
