core.log("Plate solve and update solution");

var first = true;

var update = core.question("Update FITS header with solution?", ["yes", "no"], "Update FITS header") == "yes";
var blind = core.question("Do blind solve every image?", ["yes", "no"], "Blind solve?") == "yes";

for(file of files)
{
	if(file.suffix() == "fits" || file.suffix() == "fit" || file.suffix() == "xisf")
	{
        var solution = file.solve(update);
        if(first && !blind)
		{
			core.setStartingSolution(solution);
			first = false;
		}
		core.log(file.fileName() + " " + "RA: " + (solution.ra / 15) + "h DEC: " + solution.dec + "deg");
	}
}
