What's new
Photoshop Gurus Forum

Welcome to Photoshop Gurus forum. Register a free account today to become a member! It's completely free. Once signed in, you'll enjoy an ad-free experience and be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Trying to make an action: replace all images in a batch with a specific image?


trclocke

New Member
Messages
2
Likes
0
Hi all. Can't seem to wrap my head around this one.

Basically I want a batch action to take a folder full of images, retain the filenames, but replace all target images in the batch with duplicates of one specific source image.

Things I've tried:
  • Pasting from the clipboard seems to be no good since the image is transparent. I have the source image positioned the way I want it, but "select all, copy, paste" will re-center it in the wrong spot since the clipboard ignores transparency.
  • I tried leaving the source image open and attempted to duplicate the source image's layer onto the target image, but that's no good since the action just records changes to the specific target image I'm starting with and returns errors if I'm trying to batch a target image with a different file name.
  • I guess maybe I could have multiple save steps in the action, but since the filenames and number of images I'll be batching are going to vary, I'm not sure how that would work.
For me actions are a bit of a headache to set up sometimes, but so useful once you get there. Thanks in advance for any advice!
 

colleague

Guru
Messages
824
Likes
1,253
let's say that select all ,copy paste always re-center it
can't you record a move layer after that with x pixels and y pixels ?
 

Tom Mann

Guru
Messages
7,223
Likes
4,343
If I understand you correctly, you can do what you want completely outside of any image editing program by simply using the batch file facility in the particular OS you are using. The exact syntax will be different depending on whether you use Mac, Unix, or one of the variants of windows, so here's some pseudo-code:

for (each file_name in directory)
{
copy master_source_image.jpg to temp.jpg;
rename temp.jpg file_name.jpg
}

HTH,

Tom
 

trclocke

New Member
Messages
2
Likes
0
let's say that select all ,copy paste always re-center it
can't you record a move layer after that with x pixels and y pixels ?
That would work, good thought. The downside is that the move step will be different for each source image, but it's at least a feasible solution. Thanks much.

If I understand you correctly, you can do what you want completely outside of any image editing program by simply using the batch file facility in the particular OS you are using. The exact syntax will be different depending on whether you use Mac, Unix, or one of the variants of windows, so here's some pseudo-code:

for (each file_name in directory)
{
copy master_source_image.jpg to temp.jpg;
rename temp.jpg file_name.jpg
}

HTH,

Tom

This is also a good point. I'd need to use an app to generate a text list of the files I'm working with (there are a lot of them) and then edit that to include the proper batch commands, but the end result would be correct.


It's too bad photoshop has no way of copying an entire layer including transparency, or of creating variable actions for duplicate layer commands. Either way thanks for the ideas everyone.
 

Tom Mann

Guru
Messages
7,223
Likes
4,343
Actually, trcloke, not that it's all that difficult, but in most operating systems, you don't need to generate your own list of the files in a directory. Doing something to all the files in a directory is an operation that is often needed, and most operating systems provide commands to do exactly that. Specifically, read through the following links. Since you haven't told us what OS you are using, I used an example from DOS, but similar commands exist in all the variants of UNIX that I know, and probably exist in Macs, but I'm not familiar with that OS.

How to do something to each file in a directory with a batch script , and,

Loop Through All Files In A Directory With DOS Batch


These links should show you that you can do exactly what I said, using the "for" command in a batch file. It only will take a few lines of code, will be vastly more efficient and use less memory than opening and manipulating images within PS, and is a very worthwhile skill to develop.

HTH,

Tom

PS - Although you don't need it for this project, should you ever need a list of all the files in a directory put in a text file, just search on {dos redirection} and/or {dos pipes}. It's incredibly simple: at the command prompt, you just type something like: dir *.* > list.txt, and you have what you want.
 

Top