Mobile app version of vmapp.org
Login or Join
Samaraweera207

: How to create different file names for every new document in Photoshop? I have an A4 size document with 6 Photos, while I am trying to cut one photo from the original and create a new document

@Samaraweera207

Posted in: #Actions #AdobePhotoshop #Automation #Export

I have an A4 size document with 6 Photos, while I am trying to cut one photo from the original and create a new document the new file name is created as "Untitled-1".

Since I am using an Action to cut from original and paste it into the new document, every new file is opened with same name as "Untitled-1" and while saving it replaces the existing.

Is there any way to make every new document with sequence number in Photoshop?

Please find below screenshot for your clear understanding.

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Samaraweera207

2 Comments

Sorted by latest first Latest Oldest Best

 

@Ogunnowo857

This takes some setting up, but should do what you want.

The script finds out how many files you have in the output folder first. It then duplicates the current document with a new name based on the previous document and adds the number of files in the output folder at the end of the filename. If output folder is empty, the number is 0. So the naming scheme is something like:

My photoshop document 0.jpg,
My photoshop document 1.jpg,
My photoshop document 2.jpg


Setting up the script:


Save this script as .jsx file:

var outputFolder = "/Users/joonas/Desktop/This be a test";
var fileformat = "jpg";

// ================================================

var docName = app.activeDocument.name;
var outputFilesLength = new Folder( outputFolder ).getFiles( '*.' + fileformat).length;

app.activeDocument.duplicate( docName + " " + outputFilesLength );

var newDoc = app.activeDocument;

newDoc.flatten();
newDoc.activeLayer.name = 'Background';
newDoc.activeLayer.visible = false;



Replace the variable outputFolder with the same output path that you got in the Save item of your Action. This folder should never have any other files, except the output files.
Replace the variable fileformat with what ever file format you're saving to in the Save item of your Action.

Remove Make item from your Action and replace it with a recording of you opening the script from: File > scripts > browse....

10% popularity Vote Up Vote Down


 

@Miguel516

I would fasten the action and the job by:


action would be just "duplicate layer" when place is selected. In dropdown menu chose "new"
Using Batch for saving files where you could set names and generate them by numbers.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme