Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- currentNameWithExtension = activeDocument.name.toString();
- var fileNameNoExtension = currentNameWithExtension;
- fileNameNoExtension = fileNameNoExtension.split( "." );
- if ( fileNameNoExtension.length > 1 ) {
- fileNameNoExtension.length--;
- }
- var currentName = fileNameNoExtension;
- var cutNumbers = fileNameNoExtension.toString();
- cutNumbers = cutNumbers.split( "_" );
- //alert("Filename is: " + currentName);
- //alert("String split is: " + cutNumbers[0] + ", " + cutNumbers[1] + ", " + cutNumbers[2] + ", " + cutNumbers[3] + ", " + cutNumbers[4]);
- var preNum = cutNumbers[0] + "_" + cutNumbers[1] + "_" + cutNumbers[2] + "_" + cutNumbers[3] + "_";
- var postNum = cutNumbers[4];
- //alert("preNum is: " + preNum + ". postNum is: " + postNum);
- var FileNum = Number(postNum);
- var fileNumStr = FileNum;
- if ( FileNum < 100 && FileNum > 9 ) {
- fileNumStr = "0" + FileNum;
- }
- else if ( FileNum < 10 ) {
- fileNumStr = "00" + FileNum;
- }
- else {
- fileNumStr = FileNum;
- }
- //alert(FileNum + " " + fileNumStr);
- var thisDocument = activeDocument;
- var filePath = thisDocument.path;
- //alert(filePath);
- var openFileAt = filePath + "/";
- var nextFileNum = FileNum += 1;
- var nextFileNumStr = nextFileNum;
- if ( nextFileNum < 100 && nextFileNum > 9 ) {
- nextFileNumStr = "0" + nextFileNum;
- }
- else if ( nextFileNum < 10 ) {
- nextFileNumStr = "00" + nextFileNum;
- }
- else {
- nextFileNumStr = nextFileNum;
- }
- var nextFileFull = openFileAt + preNum + nextFileNumStr + ".png";
- //alert("Next file is: " + nextFileFull);
- activeDocument.close(SaveOptions.DONOTSAVECHANGES);
- app.open( new File ( nextFileFull ) );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement