final String ext, final Writer out) {
try {
parent.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
ScriptEngineManager mgr = new ScriptEngineManager();
ScriptEngine engine = mgr.getEngineByExtension(ext);
engine.getContext().setWriter(out);
engine.getContext().setErrorWriter(out);
engine.put("session", model.getClientSession().getSession());
engine.put("binding", model.getClientSession().getSession().getBinding());
engine.put("out", new PrintWriter(out));
engine.eval(new FileReader(file));
} catch (Exception ex) {
ClientHelper.showError(null, ex);
} finally {
parent.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
}