Copy link to clipboard
Copied
The free Javascript "Save-Incrementally.jsx" for Adobe Illustrator 2022, Adobe Photoshop 2022 and Adobe InDesign 2022 or older versions saves the current saved document in the file format .ai, .psd or .indd and automatically adds a consecutive number to the file name. Thus, the file "Example.ai" becomes the file "Example-0001.ai", "Example-0002.ai" and so on; this works analogously for Photoshop and InDesign. This is also called "incremented" (continuous) saving. In this way, you can save individual steps in between and go back to an older version if necessary. The Javascript also works with older versions of Illustrator, Photoshop and InDesign.
See my Behance profile or on my german website.
Have fun with it and merry christmas to all.
– jens
As it looks like @Parts4Arts is no longer active, you can download various versions of the scripts from my archive here:
There are other scripts on this forum to save incremental files, however they are only for Photoshop.
Copy link to clipboard
Copied
@SandraPL wrote:
Hi guys,
was looking for this kind of function for a while now and happy to find something that is quite a good base.
BUT I was wondering if this script could be re-scripted that it's actually saving the files like a real incremental save would do it, so version up your file and NOT adding a new version counter at the ending.
Is this even possible?
Thanks a lot,
Sandra
If I understand what I think you're requesting, then no.
Scripts can't change how Photoshop file formats work. So we can't make a single file with various version states hidden in the file from which we can pick from. As Photoshop isn't a database, we can't track revisions using BLOBs either.
If you meant something else, then please spell it out in more detail.
Copy link to clipboard
Copied
thanks for coming back on this request.
In detail: I would like to only version up e.g. from *_comp_v001 -> *_comp_v002.
The script is working instead like this *_comp_v001 -> *_comp_v001-0000.
Thanks,
Sandra
Copy link to clipboard
Copied
thanks for coming back on this request.
In detail: I would like to only version up e.g. from *_comp_v001 -> *_comp_v002.
The script is working instead like this *_comp_v001 -> *_comp_v001-0000.
Thanks,
Sandra
By @SandraPL
Ah, OK, I didn't understand you, thanks for the clarification.
Are you referring to the script originally shared, that is no longer available from the original link, which Is available from the personal archive that I shared via DropBox? If so, which script version number?
If you are referring to one of the alternatives offered in this topic thread, then which one?
Copy link to clipboard
Copied
Downloaded the package that was shared from you on 12th Sep. 2024 and used the version 2.7 (ai_ps_id_ic_fm_Save-Incrementally_2-7).
Copy link to clipboard
Copied
Downloaded the package that was shared from you on 12th Sep. 2024 and used the version 2.7 (ai_ps_id_ic_fm_Save-Incrementally_2-7).
By @SandraPL
OK, that script is a big one, as it's for Ps/Ai/Id
Do you only need incremental saves in Photoshop? If so, only for PSD or other formats?
I'm guessing that it will be quicker and easier to use or modify a simpler script.
Copy link to clipboard
Copied
For PS would be totally enough and for the formats psd and psb.
Copy link to clipboard
Copied
For PS would be totally enough and for the formats psd and psb.
By @SandraPL
OK, I'll look into this for you.
Copy link to clipboard
Copied
For PS would be totally enough and for the formats psd and psb.
By @SandraPL
Rather than modifying the original cross-application script, it was quicker to change an existing script.
Here it is for PSD:
/*
Save Incremental PSD Copies.jsx
Stephen Marsh
v1.0 - 7th February 2025
https://community.adobe.com/t5/photoshop-ecosystem-discussions/save-copy-incrementally-with-javascript-in-photoshop/td-p/12616102/page/2
Based on:
https://community.adobe.com/t5/photoshop-ecosystem-discussions/save-increments-and-save-embedded-colour-profile-jpg-and-png/td-p/14775268
*/
#target photoshop
saveIncrementally();
function saveIncrementally() {
try {
var saveFolder = app.activeDocument.path;
if (!Folder(saveFolder).exists) {
saveFolder = Folder.selectDialog("Select output folder");
if (!saveFolder)
return;
}
var docName = decodeURI(activeDocument.name);
var saveName = docName.replace(/\.[^\.]+$/, ''); // Remove the file extension
var suffix = zeroPad(1, 3); // Start number, Save suffix length
var myFile = saveFolder + "/" + saveName + "_v" + suffix + ".psd";
while (File(myFile).exists) {
var suffixInteger = parseInt(suffix, 10);
suffixInteger += 1;
suffix = zeroPad(suffixInteger, 3);
myFile = saveFolder + "/" + saveName + "_v" + suffix + ".psd";
}
savePSD(myFile);
app.beep();
} catch (e) {
alert(e.toString() + "\nLine: " + e.line.toString());
}
// Helper functions
function savePSD(saveFile) {
var psdSaveOptions = new PhotoshopSaveOptions();
psdSaveOptions.embedColorProfile = true;
psdSaveOptions.alphaChannels = true;
psdSaveOptions.layers = true;
psdSaveOptions.annotations = true;
psdSaveOptions.spotColors = true;
app.activeDocument.saveAs(File(saveFile), psdSaveOptions, true); // false = save as | true = save a copy
}
function zeroPad(num, digit) {
var tmp = num.toString();
while (tmp.length < digit) { tmp = "0" + tmp; }
return tmp;
}
}
And here it is for PSB:
/*
Save Incremental PSB Copies.jsx
Stephen Marsh
v1.0 - 7th February 2025
https://community.adobe.com/t5/photoshop-ecosystem-discussions/save-copy-incrementally-with-javascript-in-photoshop/td-p/12616102/page/2
Based on:
https://community.adobe.com/t5/photoshop-ecosystem-discussions/save-increments-and-save-embedded-colour-profile-jpg-and-png/td-p/14775268
*/
#target photoshop
saveIncrementally();
function saveIncrementally() {
try {
var saveFolder = app.activeDocument.path;
if (!Folder(saveFolder).exists) {
saveFolder = Folder.selectDialog("Select output folder");
if (!saveFolder)
return;
}
var docName = decodeURI(activeDocument.name);
var saveName = docName.replace(/\.[^\.]+$/, ''); // Remove the file extension
var suffix = zeroPad(1, 3); // Start number, Save suffix length
var myFile = saveFolder + "/" + saveName + "_v" + suffix + ".psb";
while (File(myFile).exists) {
var suffixInteger = parseInt(suffix, 10);
suffixInteger += 1;
suffix = zeroPad(suffixInteger, 3);
var myFile = saveFolder + "/" + saveName + "_v" + suffix + ".psb";
}
savePSB();
app.beep();
function savePSB() {
var s2t = function (s) {
return app.stringIDToTypeID(s);
};
var descriptor = new ActionDescriptor();
var descriptor2 = new ActionDescriptor();
descriptor2.putBoolean(s2t("maximizeCompatibility"), true);
descriptor.putObject(s2t("as"), s2t("largeDocumentFormat"), descriptor2);
descriptor.putPath(s2t("in"), new File(myFile));
descriptor.putBoolean(s2t("copy"), true); // false = save as | true = save a copy
descriptor.putBoolean(s2t("lowerCase"), true);
executeAction(s2t("save"), descriptor, DialogModes.NO);
}
function zeroPad(num, digit) {
var tmp = num.toString();
while (tmp.length < digit) { tmp = "0" + tmp; }
return tmp;
}
} catch (e) {
alert(e.toString() + "\nLine: " + e.line.toString());
}
}
https://prepression.blogspot.com/2017/11/downloading-and-installing-adobe-scripts.html
Copy link to clipboard
Copied
Thanks for taking a look and re-scripting.
Tested it right away and the file gets still an extension every time I save though, see screenshot.
Also it's only using v001 not counting up.
Copy link to clipboard
Copied
You can't add your own manual incrementing filename as a base name and expect the script to carry on from there (unless the script was designed to do so, which it wasn't).
So, start with a base name without any manual version control digits, i.e.:
myFile.psd
The script will produce files as:
myFile_v001.psd
myFile_v002.psd
myFile_v003.psd
etc.
Copy link to clipboard
Copied
Ok got it. That worked!
But that would mean the file/s need/s to be open till it's/they're finished.
Really appreciate your support.
Copy link to clipboard
Copied
Ok got it. That worked!
But that would mean the file/s need/s to be open till it's/they're finished.Really appreciate your support.
By @SandraPL
These scripts are designed to create incremental backup copies of the working file for safety, leaving the working file open, as is. The working file needs to be manually saved as required by the user. The script could be updated to save the open working file each time that it creates an incremental copy.
It's possible to change the scripts so that a Save As is performed instead of Save a Copy, then the open document becomes the next incremented document. Is that what you are looking for?
Copy link to clipboard
Copied
The following scripts are designed to Save As rather than Save a Copy.
PSD:
/*
Save As Incremental PSD Without Copy.jsx
Stephen Marsh
v1.0 - 8th February 2025
https://community.adobe.com/t5/photoshop-ecosystem-discussions/save-copy-incrementally-with-javascript-in-photoshop/td-p/12616102/page/2
Based on:
https://community.adobe.com/t5/photoshop-ecosystem-discussions/save-increments-and-save-embedded-colour-profile-jpg-and-png/td-p/14775268
*/
#target photoshop
saveIncrementally();
function saveIncrementally() {
try {
var saveFolder = app.activeDocument.path;
if (!Folder(saveFolder).exists) {
saveFolder = Folder.selectDialog("Select output folder");
if (!saveFolder)
return;
}
var docName = decodeURI(activeDocument.name);
var saveName = docName.replace(/\.[^\.]+$/, ''); // Remove the file extension
var suffixMatch = saveName.match(/_v(\d{3})$/);
var suffix = suffixMatch ? suffixMatch[1] : zeroPad(1, 3); // Start number, Save suffix length
if (suffixMatch) {
saveName = saveName.replace(/_v\d{3}$/, ''); // Remove the existing suffix
}
var myFile = saveFolder + "/" + saveName + "_v" + suffix + ".psd";
while (File(myFile).exists) {
var suffixInteger = parseInt(suffix, 10);
suffixInteger += 1;
suffix = zeroPad(suffixInteger, 3);
myFile = saveFolder + "/" + saveName + "_v" + suffix + ".psd";
}
savePSD(myFile);
app.beep();
} catch (e) {
alert(e.toString() + "\nLine: " + e.line.toString());
}
// Helper functions
function savePSD(saveFile) {
var psdSaveOptions = new PhotoshopSaveOptions();
psdSaveOptions.embedColorProfile = true;
psdSaveOptions.alphaChannels = true;
psdSaveOptions.layers = true;
psdSaveOptions.annotations = true;
psdSaveOptions.spotColors = true;
app.activeDocument.saveAs(File(saveFile), psdSaveOptions, false); // false = save as | true = save a copy
}
function zeroPad(num, digit) {
var tmp = num.toString();
while (tmp.length < digit) { tmp = "0" + tmp; }
return tmp;
}
}
PSB:
/*
Save As Incremental PSB Without Copy.jsx
Stephen Marsh
v1.0 - 8th February 2025
https://community.adobe.com/t5/photoshop-ecosystem-discussions/save-copy-incrementally-with-javascript-in-photoshop/td-p/12616102/page/2
Based on:
https://community.adobe.com/t5/photoshop-ecosystem-discussions/save-increments-and-save-embedded-colour-profile-jpg-and-png/td-p/14775268
*/
#target photoshop
saveIncrementally();
function saveIncrementally() {
try {
var saveFolder = app.activeDocument.path;
if (!Folder(saveFolder).exists) {
saveFolder = Folder.selectDialog("Select output folder");
if (!saveFolder)
return;
}
var docName = decodeURI(activeDocument.name);
var saveName = docName.replace(/\.[^\.]+$/, ''); // Remove the file extension
var suffixMatch = saveName.match(/_v(\d{3})$/);
var suffix = suffixMatch ? suffixMatch[1] : zeroPad(1, 3); // Start number, Save suffix length
if (suffixMatch) {
saveName = saveName.replace(/_v\d{3}$/, ''); // Remove the existing suffix
}
var myFile = saveFolder + "/" + saveName + "_v" + suffix + ".psb";
while (File(myFile).exists) {
var suffixInteger = parseInt(suffix, 10);
suffixInteger += 1;
suffix = zeroPad(suffixInteger, 3);
myFile = saveFolder + "/" + saveName + "_v" + suffix + ".psb";
}
savePSB();
app.beep();
} catch (e) {
alert(e.toString() + "\nLine: " + e.line.toString());
}
// Helper functions
function savePSB() {
var s2t = function (s) {
return app.stringIDToTypeID(s);
};
var descriptor = new ActionDescriptor();
var descriptor2 = new ActionDescriptor();
descriptor2.putBoolean(s2t("maximizeCompatibility"), true);
descriptor.putObject(s2t("as"), s2t("largeDocumentFormat"), descriptor2);
descriptor.putPath(s2t("in"), new File(myFile));
descriptor.putBoolean(s2t("copy"), false); // false = save as | true = save a copy
descriptor.putBoolean(s2t("lowerCase"), true);
executeAction(s2t("save"), descriptor, DialogModes.NO);
}
function zeroPad(num, digit) {
var tmp = num.toString();
while (tmp.length < digit) { tmp = "0" + tmp; }
return tmp;
}
}
Copy link to clipboard
Copied
Wow! Thanks that's awesome.
Exactly what I needed.
Thanks a ton for your work and quick turn around.
Copy link to clipboard
Copied
Wow! Thanks that's awesome.
Exactly what I needed.
Thanks a ton for your work and quick turn around.
By @SandraPL
You're welcome!
Find more inspiration, events, and resources on the new Adobe Community
Explore Now