I think this is impossible to do. While an action or script is being executed, the generator can not be activated.
If you have windows, you can try this script.
Close all the documents in Photoshop and run the script.
Select the desired files in the FileOpenDialog.
The script will create a temporary script and bat-file in the temporary folder.
Then run bat-file. At the end of the run, you need to close the last file in Photoshop manually.
var ps_name = app.path.fsName + "\\Photoshop.exe";
var gn_name = app.path.fsName + "\\Presets\\Scripts\\generate.jsx";
var files = app.openDialog();
if (files)
{
var sc_name = Folder.temp.fsName + "\\" + "temp.jsx";
var sc_file = new File(sc_name);
sc_file.encoding = "UTF8";
sc_file.open("w");
sc_file.writeln("while (documents.length > 1) documents[0].close(SaveOptions.DONOTSAVECHANGES)");
sc_file.writeln("$.evalFile(" + gn_name.toSource() + ")");
sc_file.close();
var bat_name = Folder.temp.fsName + "\\" + "temp.bat";
var bat_file = new File(bat_name);
bat_file.encoding = "UTF8";
bat_file.open("w");
for (var i = 0; i < files.length; i++)
{
bat_file.writeln("\"" + ps_name + "\"" + " " + "\"" + files.fsName + "\"");
bat_file.writeln("\"" + ps_name + "\"" + " " + "\"" + sc_name + "\"");
bat_file.writeln("timeout 3");
}
bat_file.close();
bat_file.execute();
}