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
Braniac
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
Braniac
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
Braniac
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
Braniac
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
Braniac
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.

MavrossAuthor
Participating Frequently
September 3, 2018

Have you made actions before? Have you used the Batch command before to run an action over a folder containing multiple files?

Filename to Layer is simply what I called my action set, rather than the default Set 11 etc. Same for the action Run rather than Action 11 etc.

P.S. The AddFileName20pt.jsx should be fine, the error was in my action (I used set current text layer when I should have used set text style of current layer).


This is my second day of using photoshop and I haven't gotten around to really watching anything about it so so far I've only ever done anything you've said, and I doubt I've done it correctly. The addfilename20 worked, and it did add the file, but it was very small and it was in the middle of the photo. Is there anyway I can set it to put the text in a different color, place, and size? The other thing from earlier that was similar to that from tejwani was closer to what I was looking for, but the max text size wasn't high enough for me and couldn't change the colors. And no, I don't know what actions really are, but from the name I have a decent guess; not sure how to execute them properly though.