Skip to main content
Inspiring
May 17, 2017
Answered

Photoshop Variables - How do you Name Files from a Spreadsheet Column?

  • May 17, 2017
  • 3 replies
  • 18142 views

I'm using Photoshop CC Variables to create 3000 images from a CSV. As well as the image content, I also have a column of prepared filenames that match and identify the content. I want to avoid image001.psd, image002.psd etc as it would mean manually naming them or getting someone to do it with coding to match it all up.

So do you know how to get Photoshop to pull through the file names from a CSV and name the files as part of variables processing?

[If not] I could do this after variables processing by piping the file list of PSDs at the Command Prompt to a .txt file, and add this to a new CSV. Photoshop, or some other software, would then need to replace the PSD names with the names in the CSV. Obviously, this assumes Photoshop creates images in the same order as they appear on the sheet (or it will go out of sync). How would I do this?

Cheers, Paul

This topic has been closed for replies.
Correct answer peace2000

Thank you both for taking the time to reply.

The video on this page could be helpful for anyone trying naming files from within Photoshop.

http://www.michaelthemaven.com/?postID=1703&photoshop-variables

Regarding the parsing, this turned out to be to do with commas, semicolons and other chars. I understand from a colleague who completed the task that he replaced these chars.

3 replies

peace2000Author
Inspiring
December 5, 2017

Some people name their output files using a column in their spreadsheet/text file with a file name for each data set (row/image). If so...

  • Ensure file names are in the first column in the spreadsheet/text file.
  • Ensure the Photoshop file name layer is a text layer by drawing a text box. Any size. No need to write text in it. If it isn't a text layer, there will be one more variable in the text file than in the Photoshop file, hence the error.
  • Make this a hidden layer (eye off, you don't want file names on the image).
  • In Define Variables, choose ‘Text Replacement’.
  • Ensure text replacement Name matches column name in the spreadsheet/text file.
  • Re-import text file, replacing the previous one.

The relationship between the names:

peace2000AuthorCorrect answer
Inspiring
May 17, 2017

Thank you both for taking the time to reply.

The video on this page could be helpful for anyone trying naming files from within Photoshop.

http://www.michaelthemaven.com/?postID=1703&photoshop-variables

Regarding the parsing, this turned out to be to do with commas, semicolons and other chars. I understand from a colleague who completed the task that he replaced these chars.

Stephen Marsh
Community Expert
Community Expert
May 17, 2017

So no need to look for a solution, you are all sorted now that your colleague has completed the task?

JJMack
Community Expert
Community Expert
May 17, 2017

https://forums.adobe.com/people/dr.+paulp39115626  wrote

I'm using Photoshop CC Variables to create 3000 images from a CSV. As well as the image content, I also have a column of prepared filenames that match and identify the content. I want to avoid image001.psd, image002.psd etc as it would mean manually naming them or getting someone to do it with coding to match it all up.

If you want to populate your template PSD variable layer with image001.psd, image002.psd etc  I would believe their full Paths and filename would need to be in your CSV. To match variable name to your files.  In you do not want to populate image001.psd, image002.psd etc then they should not be in your CSV file.

Re: Action script that could automate quote placement via csv file?

I have never had the need to use Data Driven graphics when I read about  all it seem to be was a matching game.  You define layers is  you Template variable layers image and text layers.  You Create a CSV the firs row is the in the CVS is a header row the variable names you defined in the Template PSD  to identif the CSV columns data to layers.

JJMack
peace2000Author
Inspiring
May 17, 2017

Thanks JJMack. Here's where I'm now at. I can create a small set of images with filenames pulled from a spreadsheet. But these are less than ideal as they're based on another variable. So I added a dedicated column with exact file names. I'm getting an error when importing the CSV into Data Sets:

"Could not parse the file contents as a data set. There were too many variable names in the first line of the text file."

peace2000Author
Inspiring
May 18, 2017

Thanks dr.paulp… The video linked in reply #4, it does indeed appear that Photoshop has an option to export out one of the variables as dataset filenames… I thought that is was strange that Illustrator had this feature while Photoshop did not, however I am so used to the programming teams working in silos and not together that I am no longer surprised by differences and just accept them.

Here is the option that I was missing:

So much easier than the alternative that I was exploring using metadata to use as a mechanism for file name replacement!


Also, if ever the naming is only partially correct, I'd highly recommend Bulk Rename Utility.

Let's say you have a batch of 1200x1200 images for retina display and now you need the half-size regular images for other devices, at 600x600. There is no need to create further columns or define more variables in the spreadsheet/CSV and Photoshop.

Instead of using 'Variables', switch to Photoshop 'Actions'. These record keystrokes and then applies the full process to the batch. So you can downsize a sample image (using the appropriate resampling method) and output to a new folder. For now, these will have the same name as the 1200x1200. BUt we don't need to stress about getting that perfect if it contains at least the working essence of a final name.

Process both batches to .png in the free FastStone Image Resizer. It handles thousands of images in minutes.

Now use the free Bulk Rename Utility to rename the 1200x1200 files to something like chocolate_x2.png

Highlight all files and add _x2 as a suffix across them all in seconds.

These process have totally transformed what I'm doing.