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
Thank you for sharing!
Copy link to clipboard
Copied
The new version 1.5 saves the original document in Illustrator and InDesign. The copy with the sequential number is created faster by the operating system.
– jens.
Copy link to clipboard
Copied
I did not understand how to download the file, you can put links on the forum
Copy link to clipboard
Copied
Hello Geppetto,
click on this link to go to my behance post.
Read the text and scoll down, to dowload the .zip-file.
– jens
Copy link to clipboard
Copied
Update Version 1.7: Saves the sequentially numbered copy in the same file format as the working file like psd, psb, bmp, eps, gif, jpg, pdf, png, raw, tga or tif in Photoshop.
Copy link to clipboard
Copied
Thanks for providing the script. Firefox threw up this error:
I don't think it's serious, but the download link is:
http://www.computergrafik-know-how.de/wp-content/uploads/2021/12/A117-2D-AI-JS-Save.zip
I guess it thinks http instead of https is a risk.
Copy link to clipboard
Copied
If you right click a link to open it in new card instead of tab, does the download start without warning?
Copy link to clipboard
Copied
My browser doesn't have a "new card", unless you mean "new window", and yes I get the warning there. I click on "Allow download" anyway because the warning seems to be over a non-https connection.
Copy link to clipboard
Copied
That's the same word in this context. Anyway on Chrome there's no warning in any scenario.
Copy link to clipboard
Copied
Update to version 2.0 with more features and user interface. Here the example from in Photoshop.
See my Behance profile or on my german website.
Copy link to clipboard
Copied
// Step 0d: Check if work file is saved
try {
var vFullName = ""+vDocRef.fullName; // Trick to convert to string
var vPos = vFullName.lastIndexOf(vSeparator);
vWorkPath = vFullName.substring(0,vPos);
if (vFullName.charAt(0) == vSeparator) { vError = aMsg[[3,cLanguage]];} // stop, if document is unsaved, for AI
}
catch (e) {vError = aMsg[[3,cLanguage]];} // for Photoshop
Check it in Photoshop. Condition vFullName.charAt(0) == vSeparator is always true for saved files
Copy link to clipboard
Copied
Hello jazz-y,
thanks for your answer.
If you use Photoshop, than you will get – without 'try' – the error 8103 if the work file was'nt saved before.
If you use Illustrator, than the condition 'vFullName.charAt(0) == vSeparator' is only true, when the file is not saved on the local harddisk. If so the path will begin with '~' like '~/Desktop'.
I have extended the programming. Now in version 2.1 you can also save copies to external hard drives or network drives.
Another new feature is that if you click on "Path for copy" and then on "Cancel" in the next window, the path for copy is reset and the copy is saved in the same directory (again) as the working file.
see https://www.behance.net/gallery/133799381/Javascript-for-AI-PS-ID-Save-with-automatic-numbering
Best regards,
– j.
Copy link to clipboard
Copied
sTT = stringIDToTypeID, mimeType = sTT('mimeType');
(ref = new ActionReference()).putProperty(sTT('property'), mimeType)
ref.putEnumerated(sTT('document'), sTT('ordinal'), sTT('targetEnum'))
executeActionGet(ref).getString(mimeType) && activeDocument.saved
Copy link to clipboard
Copied
The new version 2.5 of my javascript »Save-Incrementally.jsx« can be used in InCopy as well.
See https://www.behance.net/gallery/133799381/Javascript-for-AI-PS-ID-Save-with-automatic-numbering
or in German http://www.computergrafik-know-how.de/javascript-datei-mit-automatischer-nummerierung-speichern/
– j.
Copy link to clipboard
Copied
Any chance you have a currently working version? All links are dead as of 09/09/2024
Copy link to clipboard
Copied
Since 01 February my website is running on https 🙂 There was no danger before and there is no danger now to download anything from there.
– j.
Copy link to clipboard
Copied
Thank you. No more errors. I never thought there was anything malicious, but when my Firefox browser throw up warnings I need to find out exactly why.
Copy link to clipboard
Copied
This sounds great, but when I use it to save an incremented png it just overwrites the previous png. Any ideas?
Copy link to clipboard
Copied
Also... I'm trying to use 'date and time' instead of the counter option to prevent it from overwriting the previous save, but everytime I try to save it it just tries to save a psd. Tif works fine but I need png.
Copy link to clipboard
Copied
bro, your link not working.
Copy link to clipboard
Copied
Copy link to clipboard
Copied
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
Links to some of the alternative incremental scripts:
#target photoshop
main();
function main() {
if (!documents.length) return;
var Name = app.activeDocument.name.replace(/\.[^\.]+$/, '');
try {
var savePath = activeDocument.path;
} catch (e) {
alert("You must save this document first!");
}
var fileList = savePath.getFiles("*.jpg").sort().reverse();
var Suffix = 0;
if (fileList.length) {
Suffix = Number(fileList[0].name.replace(/\.[^\.]+$/, '').match(/\d+$/));
}
Suffix = zeroPad(Suffix + 1, 3);
//var saveFile = File(savePath + "/" + Name + "_" + Suffix + ".jpg");
var saveFile = File(savePath + "/" + Suffix + ".jpg");
SaveJPEG(saveFile, 8); // JPEG compression level
}
function SaveJPEG(saveFile, jpegQuality) {
jpgSaveOptions = new JPEGSaveOptions();
jpgSaveOptions.embedColorProfile = true;
jpgSaveOptions.formatOptions = FormatOptions.STANDARDBASELINE;
jpgSaveOptions.matte = MatteType.NONE;
jpgSaveOptions.quality = jpegQuality;
activeDocument.saveAs(saveFile, jpgSaveOptions, true, Extension.LOWERCASE);
}
function zeroPad(n, s) {
n = n.toString();
while (n.length < s) n = '0' + n;
return n;
}
// Save PNG next to PSD (Incremental numbers).jsx
#target photoshop
var savePSD = false; // If set true the psd document is saved every time the script runs...
var folderName = ' (Frames)';
try {
var doc = app.activeDocument;
var fileExists = false;
try { if ( savePSD ) doc.save(); } catch(e){}
try {
fileExists = doc.path;
}
catch(e){
var idsave = charIDToTypeID( "save" );
var desc50 = new ActionDescriptor();
var idIn = charIDToTypeID( "In " );
desc50.putPath( idIn, new File( Folder.desktop.fullName ) );
var idDocI = charIDToTypeID( "DocI" );
desc50.putInteger( idDocI, 196 );
var idsaveStage = stringIDToTypeID( "saveStage" );
var idsaveStageType = stringIDToTypeID( "saveStageType" );
var idsaveSucceeded = stringIDToTypeID( "saveSucceeded" );
desc50.putEnumerated( idsaveStage, idsaveStageType, idsaveSucceeded );
executeAction( idsave, desc50, DialogModes.ALL );
fileExists = doc.path;
}
if ( fileExists ) {
saveNewVersion( doc );
}
}
catch( e ) {
// remove comments below to see error for debugging
// alert( e );
}
function saveNewVersion( doc, docName ) {
var extension = '.png';
var docName = doc.name.substring(0, doc.name.lastIndexOf('.'));
var docPath = doc.path;
var outputPath = docPath + '/' + doc.name + folderName;
var outputFolder = new Folder( outputPath );
if( !outputFolder.exists ) { outputFolder.create(); }
var verisonsList = outputFolder.getFiles( '*' + extension );
var versionsLength1 = verisonsList.length;
var number = getVersionNumber( docName, verisonsList );
var filename = number + extension;
doc.exportDocument( File( outputPath + '/' + filename ), ExportType.SAVEFORWEB, exportOptions() );
app.beep();
}
function getVersionNumber( docName, verisonsList ) {
var number = 0;
for ( var i = 0; i < verisonsList.length; i++ ) {
var file = verisonsList[i];
var fileName = File(file).displayName;
fileName = fileName.substring(0, fileName.lastIndexOf('.'));
// Start looking for the version number if PSD filename contains doc name...
var versionNumber = fileName.match(/^[0-9]*/);
if ( versionNumber ) {
versionNumber = parseInt( versionNumber ,10);
if ( number < versionNumber ) {
number = versionNumber;
}
}
}
return number + 1;
}
function exportOptions() {
var options = new ExportOptionsSaveForWeb();
options.format = SaveDocumentType.PNG;
options.quality = 100;
return options;
}