This cannot be done with one line.
var oStyle = app.activeDocument.objectStyles.itemByName("b");
app.findObjectPreferences = app.changeObjectPreferences = null;
app.findObjectPreferences.appliedObjectStyles = oStyle;
var fund = app.activeDocument.findObject();
app.findObjectPreferences = app.changeObjectPreferences = null;
for (var f = 0; f < fund.length; f++) {
fund[f].applyObjectStyle(oStyle, true);
}