Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Automate/batch insert unique text from a CSV file to multiple different images in Photoshop

Community Beginner ,
Jul 13, 2023 Jul 13, 2023

Hi, I have thousands of images similar to the ones shown here. They are all labelled 0.png to XXX.png. I automated the creation of a frame with two boxes to place text. I need to figure out how to add the right text to every unique image from a CSV file. The CSV file is quite simple. It contains the ID of the object in the image and some data. This obviously has to be automated/batch processed. I'm not sure if the image processor allows me to do this. 

I read about variables but found nothing that would allow me to match specific text fields in my CSV to all of my unique images. Every image is different

I use the latest version of Photoshop on a Mac. 

The first images are an example with placeholder text. The last image is a screenshot from my CSV/Numbers file. I want to add the following text to every image: ROCK_[ID] at the top and [Family ID]_[Volume]_[Polygons] at the bottom.

 

rock855_wrap.pngexpand imagerock3708_wrap.pngexpand imagerock6836_wrap.pngexpand imagerock7693_wrap.pngexpand imageScreen Shot 2023-07-13 at 14.32.04.pngexpand image

TOPICS
Actions and scripting , macOS
2.7K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Community Expert ,
Jul 13, 2023 Jul 13, 2023

@Loucas B. this would be a much easier job to produce in Adobe InDesign.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jul 13, 2023 Jul 13, 2023

Good point. Any leads? I'm not familiar with InDesign. 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 13, 2023 Jul 13, 2023

In short you create a template page using Data merge where you point to the fields in the csv.

https://helpx.adobe.com/indesign/using/data-merge.html

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jul 13, 2023 Jul 13, 2023

Thanks, I will look into it, but the thing is, I don't have a standard template. Text position varies.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 13, 2023 Jul 13, 2023
quote

Thanks, I will look into it, but the thing is, I don't have a standard template. Text position varies.


By Loucas B.

 

If you can't do this from a single template as each image is different in size, then thinking out loud... A script could open each file from the CSV, run the action that you created to create the frame and text boxes, then update each text box content from the CSV and save the completed file.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jul 13, 2023 Jul 13, 2023

If you have one like that, I'd love to try it. I just posted a solution I found.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 13, 2023 Jul 13, 2023

Use batch to run your action to create the frames and text boxes around each individual image.

 

Then setup the CSV to work with the following script from @willcampbell7 :

 

https://youtu.be/NH9bYHnlUUk

 

https://www.marspremedia.com/software/photoshop/text-update-from-csv

 

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jul 13, 2023 Jul 13, 2023

I found a solution; it's a 2 steps process,

1. Place the text I need on each image using the usual variables method as if I was making business cards. Save the results as PSD. Placement doesn't matter here; anywhere/any format will do. 
Screen Shot 2023-07-13 at 19.47.04.pngexpand image
2. Render these new PSD files containing the relevant text information through my previous framing automated actions + format the text to my needs. It's a bit of a mess with the layers selection, but it works. 
Screen Shot 2023-07-13 at 19.49.47.pngexpand image

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 13, 2023 Jul 13, 2023
quote

It's a bit of a mess with the layers selection, but it works.


By Loucas B.

 

Not sure exactly what you mean, but one should use relative keyboard shortcuts to select the layer rather than clicking on it when recording the action, or use a common generic name if clicking on the layer.

 

Relative Layer Keyboard Shortcuts for Action Recording:


Select/target front (top) layer =
Option + .

Select/target next layer up = Option + ]
Select/target next layer down = Option + [
Select/target back (bottom) layer = Option + ,

 

Move current target layer to front (top) layer = Command + Shift + ]
Move current target layer up = Command + ]
Move current target layer down = Command + [
Move current target layer to back (bottom) layer = Command + Shift + [

 

Windows users would swap the Command key for Ctrl and the Option key for Alt

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 16, 2023 Jul 16, 2023

The keyboard shortcuts don't work on my French Canadian/Mac device. I've seen other people post about this problem. The first paragraph of shortcuts you posted doesn't work :(. I also cannot find them in the custom keyboard shortcut menu. Also, some shortcuts don't seem to work when a layer is hidden. I did some research to figure this out, and the best solution I found was a script that someone made to select the next layer even if it's hidden. https://gist.github.com/joonaspaakko/048c9b58ccbb6e6f44c894bf4ce30b68 


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 16, 2023 Jul 16, 2023
LATEST

 

@defaultoeovn3bddwy5 â€“ You can try downloading my "Layer Navigation Building Blocks" action set here:

 

https://www.dropbox.com/s/dd9qpecqrvuon6e/Layer%20Navigation%20Building%20Blocks.atn?dl=0

 

relative-action-keycuts.pngexpand image

 

Then dupe the step and drag out the action step into your action.

 

It is possible to select an invisible layer with only an action, it just isn't obvious and takes extra steps that can be recorded into an action:

 

https://www.dropbox.com/s/vpttyyi6gpedrwm/Select%20Forward%20or%20Backward%20Invisible%20Layer.atn?d...

 

select-visible-layer-action.pngexpand image

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jul 16, 2023 Jul 16, 2023

(I posted a reply with the wrong account, not sure why it happened)

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines