Hi Paul,
Try the following code, it will open a window to select the folder that has your ai files and then resave it with a new name with _out appened at the end in the same folder.
var sourceFolder = Folder.selectDialog();
if(sourceFolder)
{
filesToProcess = sourceFolder.getFiles("*.ai")
if(filesToProcess != "")
{
for(var i = 0; i < filesToProcess.length; i++)
{
var doc = app.open(filesToProcess[i]);
var mySaveOptions = new IllustratorSaveOptions();
mySaveOptions.pdfCompatible = false;
//save witn new name
doc.saveAs(File(filesToProcess[i].fsName.replace(/.ai/i, "_out.ai")), mySaveOptions);
doc.close(SaveOptions.DONOTSAVECHANGES);
}
}
}
-Manan