for(ElementRule rule : window.getRules()) {
try {
if(asImage) {
sd.renderRuleToBitmapFile(rule.name, extension, XJUtils.concatPath(directory, rule.name+"."+extension));
} else {
sd.renderRuleToEPSFile(rule.name, XJUtils.concatPath(directory, rule.name+".eps"));
}
} catch (Exception e) {
XJAlert.display(window.getJavaContainer(), "Error", "Images cannot be saved because:\n"+e);
}
}