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
  • 18088 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."

Stephen Marsh
Community Expert
Community Expert
May 17, 2017

Try splitting your source CSV in half, then try again. If this does not parse, then split in half and try again etc.

I am not aware of a record limit, however there may be one. In InDesign, the largest set of records that I ever processed was for a mailer that was only for around 1200 recipients… This is considered “lightweight” for mailers!

As for your output file naming issue, I have some ideas.

If you were using Illustrator’s variables, then the fantastic Variable Importer script offers robust dataset & filenaming options:

Prepression: Illustrator – Introducing the VariableImporter Script

Prepression: Illustrator – VariableImporter Script Part 2 Tutorial

Illustrator has a great batch action feature to name save out data set files using the data set name, which can be created from one or more combinations of the variable fields when setting up the variables using the script:

However, Photoshop does not offer this feature, nor am I aware of any scripts or export options etc… That being said, I have some ideas based around metadata… Which I’ll look into!