Hello,
I have written a script that will cycle through some open indesign files (or a single file) and apply a bunch of specific layout corrections. These are enabled/disabled on a dialog window. One of the options is to either save and close each file as it is corrected or to leave them all open after the script has finished. When I run it on and choose to not save, everything works exactly as intended. The problem is with the save/close option. When this is selected the script stops after processing roughly half of the files. It doesn't report any errors, it just stops. Can anyone shed any light on to why this is happening.
Here is the section of the script where the save occurs. If it would help to post the rest I can do. Rad1 is the radio button to select between all open documents or the active one and rad4 is the save/don't save button.
function artworkFixes(){
if(g.rad1.value == true){
for(var i = 0; i < app.documents.length; i++){
g.myDoc = app.documents[i];
g.pageWidth = g.myDoc.documentPreferences.pageWidth;
bleedFix();
slugFix();
varFix();
layerFix();
swatchFix();
cutterFix();
if(g.rad4.value == true){
g.myDoc.close(SaveOptions.YES)
}
}
}
Any help would be greatly appreciated!