This is in response to a request at the Adobe forum. The script saves and closes the active document and opens the next document in a numerical series according to the rightmost numbers of the document name.
test10_101x.jpg
test10_102x.jpg
It may be better to do the saving within the same action as you use to call the script (which you then want to give an FKey) and to delete line three of the script. Download it or use the following text:
Code: Select allfunction openNextNumericalFile () {
fileString = activeDocument.fullName.toString();
activeDocument.close(SaveOptions.SAVECHANGES);
nextFile = new File (fileString.replace(/(\d+)([^\d]+)$/, function (str, p1, p2) {
return (Number(p1) + 1) + p2;}));
if (nextFile.exists) open(nextFile);
else alert('Next File Does Not Exist');
}
openNextNumericalFile ();
There is a new version of this here:
bb/viewtopic.php?t=290
Andrew