I've cleaned out extraneous code, tested on CS5, and re-uploaded above as version 0.5. Let me know, if this solves your issue.
Ken
However, since this script is pretty simple, here's the code in Adobe's native ExtendScript:
// save the following code with the extension .jsx
// not debugged, but works for me
// and place it in (Mac) Adobe Illustrator CS*/Presets/en_EN/Scripts
// restart illustrator
// now it's visible under File -> Scripts
var sel = app.activeDocument.selection;
for( var i=0; i<sel.length; i++ ) {
var obj = sel[i];
// grouped
if( obj.pathItems != undefined ) {
for( var j=0; j<obj.pathItems.length; j++ ) {
swapStrokeFill( obj.pathItems[j] );
}
}
// singular
else {
swapStrokeFill( obj );
}
}
function swapStrokeFill(obj) {
var tempStrokeColor = obj.strokeColor
var tempFillColor = obj.fillColor
if(obj.strokeColor != null && obj.fillColor == null) {
obj.fillColor = tempStrokeColor;
obj.strokeColor = null;
}
else if(obj.strokeColor == null && obj.fillColor != null) {
obj.strokeColor = tempFillColor;
obj.fillColor = null;
}
else if(obj.fillColor != null && obj.strokeColor != null) {
obj.strokeColor = tempFillColor;
obj.fillColor = tempStrokeColor;
}
};