Skip to content

Instantly share code, notes, and snippets.

@MarshySwamp
Created April 4, 2022 01:12
Show Gist options
  • Save MarshySwamp/36dca13f91c1fc0ad189be6db4120f9f to your computer and use it in GitHub Desktop.
Save MarshySwamp/36dca13f91c1fc0ad189be6db4120f9f to your computer and use it in GitHub Desktop.
Counter for saved files
/* Add an incremental counter to report on the count of files saved */
// Set the file save counter (outside the for loop...)
var counter = 0;
// fileList not included in this example
for (var i = 0; i < fileList.length; i++) {
var doc = open(fileList[i]);
// Do stuff...including file saving etc
// Increment the file save counter (end of the for loop)
counter++;
}
// End of script notification
alert('Script completed!' + '\r' + counter + ' files saved to:' + '\r' + saveFolder.fsName);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment