if (commands.size()==0 && index!=-2 && index!=-3) { log.logRed("There are no commands to execute.\n\n"); return null; }
int i=index;
if (i>=commands.size()) i=commands.size()-1;
SimpleCallback1 cb = new SimpleCallback1(this, null, log, Verbosity.get().ordinal(), latestAlloyVersionName, latestAlloyVersion);
SimpleTask1 task = new SimpleTask1();
A4Options opt = new A4Options();
opt.tempDirectory = alloyHome() + fs + "tmp";
opt.solverDirectory = alloyHome() + fs + "binary";
opt.recordKodkod = RecordKodkod.get();
opt.unrolls = Version.experimental ? Unrolls.get() : (-1);
opt.skolemDepth = SkolemDepth.get();
opt.coreMinimization = CoreMinimization.get();
opt.originalFilename = Util.canon(text.get().getFilename());
opt.solver = SatSolver.get();
task.bundleIndex = i;
task.bundleWarningNonFatal = WarningNonfatal.get();
task.map = text.takeSnapshot();
task.options = opt.dup();
task.resolutionMode = (Version.experimental && ImplicitThis.get()) ? 2 : 1;
task.tempdir = maketemp();
try {
runmenu.setEnabled(false);
runbutton.setVisible(false);