Skip to main content
Participating Frequently
September 1, 2018
Question

Automate a process

  • September 1, 2018
  • 2 replies
  • 5928 views

So I'm trying to use Photoshop to add a number and a date in about 180 images, but I don't want to go through each one individually to add each line of text. I'm making a time lapse of myself and how I changed over 180 days (an example of this would be that I shaved my hair and I'm posting a video showing the regrowth of it over 180 days. Not what I actually did but it is similar, and you can find many videos like this on YouTube demonstrating what I'm trying to do), and I'd like to add the date for each photo I took, and what day it was in the process (i.e. day 1, day 2, day 37, day 180). I'm new to Photoshop, so I don't know much about the program, but I know there's a batch command somewhere; I wasn't able to find a tutorial anywhere on the specific thing I'm trying to do though. How could I add the specific day and date for each photo while not having to go through all of them individually?

This topic has been closed for replies.

2 replies

Kukurykus
Brainiac
September 4, 2018

I wrote a script that put on image (but in down right corner) a date writen to metadata. It's also not on white background: Re: Way to have the "create just date " to print into photo? / Here is also rewriten version for your specific expectation:

displayDialogs = DialogModes.NO, preferences.rulerUnits = Units.PIXELS;

(aD = activeDocument).artLayers.add().kind = LayerKind.TEXT

d = aD.info.creationDate.replace(/(\d{4})(\d{2})(\d{2})/,

function(_, v1, v2, v3, v4) {return v3 + '.' + v2 + '.' + v1})

s = aD.height / 100 * 5 * 72 / aD.resolution;

(tI = aD.activeLayer.textItem).contents = d

tI.position = [85, 170], col = new SolidColor

col.rgb.hexValue = 'FFFFFF'

tI.color = col, tI.size =  s

Try it on single layer if you know how to use this script, then it can be automated for all 180 layers. Also post your video

Stephen Marsh
Community Expert
September 5, 2018

Haha, you should see how many lines of code my hack contains, and you did it in 9!

I can’t figure out how to replace info.creationDate in line 3 to the filename.

Kukurykus
Brainiac
September 5, 2018

Change 3rd&4th lines to d = aD.name. I didn't make pattern to position for each resolution, so most appropriate now is 300.

Stephen Marsh
Community Expert
September 2, 2018

There are scripts to add the filename and or time/date stamp to the image (or EXIF metadata etc). So if you were willing to batch rename the filename to be Day 1, Day 2 etc… And if you could pull the date/time metadata out of each file, then this should be possible. Try searching in the scripting sub-forum.

how put exif data on a photo?

Otherwise, I would suggest that you look into Photoshop Variables. It should be “simple enough” to create a spreadsheet with a column for the Day 1 text and a column for the date. This could then be used to add text to each image.

Creating data-driven graphics in Photoshop

Stephen Marsh
Community Expert
September 2, 2018

Here I have used Adobe Bridge to batch rename a series of images. Each image was shot on a different day. I sorted the view by date created in Bridge. The critical point is that the sort order in Bridge is used as the input order for the batch rename command. The rename used a static text of “Day “ with a space, then it used an increment number padded with two zeros.

The filename would be picked up by a script, the script would also look for the date created metadata entry in the file as well. Both of these options would then be added as a text layer to the image.

Here is a rough sample of the output of a script (JJ Mack’s StampExif.jsx) where I removed all of the variables, except for filename and date. Further tweaks may be required, such as removing filename extension or changing date format, or the font size, colour etc. This is simply a proof of concept.

Stephen Marsh
Community Expert
September 2, 2018

Filename only:

http://blogs.adobe.com/jkost/2010/09/add-file-name-as-text-layer.html

or

https://tejwani.com/photoshop-script-insert-current-filename/

Prepression: Downloading and Installing Adobe Scripts

I’ll post more later on the action and batch.


An action that used “insert menu command” to place the installed script into the scripts menu. I have added a few other steps to change the text (which could also be done in the script):

The File > Automate > Batch settings used to run the action on a folder of images (work on a test folder first that only contains a small amount of images to ensure that all works well):

EDIT: There appears to be a problem with my copy of the “AddFileName20pt” script, however the process should be the same/similar for similar scripts.