Copy link to clipboard
Copied
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
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.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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."
Copy link to clipboard
Copied
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!
Copy link to clipboard
Copied
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!
Copy link to clipboard
Copied
There is an option in PS6 in the Export dialogue under Document Name that might help you out, don't know about later versions.
Copy link to clipboard
Copied
Thanks edgrimley, of course, that is the first thing I looked at when I originally replied, however the exported files only had variables named Data Set 1, Data Set 2 etc… They did not use the actual value mapped in from the CSV (which is why I started to look into metadata based approaches to file renaming using one of the merged variables as the source).
The caveat to using this feature correctly is to tick the box indicated in my previous post #6, which I had failed to do when importing the data source, which led me to mistakenly believe that this feature did not work (simple user error).
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
Adobe Bridge has a very capable Batch Rename tool, capable of metadata and complex regular expression based searches for renaming. I also agree that there are also many third party file renaming tools out there that are more than capable too. Of course, Photoshop is more than capable of creating batch image resizes etc with no need for third party software, however third party software may offer other alternatives or advantages too.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
So no need to look for a solution, you are all sorted now that your colleague has completed the task?
Copy link to clipboard
Copied
Regarding this error: "Could not parse the file contents as a data set. There were too many variable names in the first line of the text file."
I've since reproduced this issue. It was caused by a variable mentioned in the text file (and associated spreadsheet if you're using one) that was not also listed in Photoshop > Image > Variables > Define, and as a Layer.
Some people might use the spreadsheet/text file for many purposes, so it contains more columns than required for their images. However, Photoshop won't simply pick out the defined variables from a wider pool. It has to match.
The error is misleading, since there are not 'too many' variables in the first row of the text file (or spreadsheet columns) per se. You can have lots of variables listed there.
What it means is that:
There are more variables listed in the text file relative to those present in the Photoshop file.
The relevant variable must be added to Photoshop, or deleted from the spreadsheet and text file, to sync them.
Copy link to clipboard
Copied
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...
The relationship between the names: