Format multiple files with a template and variables

show more Format multiple files with a template and variables provides you with in-depth training on Design. Taught by Michael Ninness as part of the Photoshop CS4 Power Shortcuts show less
please wait ...

Format multiple files with a template and variables

So, I've got a great power shortcut for you here. This is a feature that's not a keyboard shortcut type of power shortcut, but it's one of those hidden obscure features that once you know about it, you're like, "Oh man! I needed that a long time ago. I wish I knew it was there." And some variables. The ability to use a template and buying that template with a set of data like a text file and a folder of images and create a series of images that are all treated the same way. So, classic example that is like sports photography and our event photographer who has to take a series of shots, let's say it's cheerleaders for lack of a better example.

You want the name of the cheerleader and their school and a custom background and a special effect or something like that. So, I've created something similar to this. This is a template file that I've got going here and this is where I want my images to come in and I want them to have a nice white border, a nice soft vignette effect on the inside of the border. I want the name of the image here or the title that I'm using to be here in large type and I want its location to be here in all caps underneath. So, in terms of setting up a template, it's no big deal. It just creating a Photoshop document, the way you want your multiple documents to look like. Let's jump over to Bridge for a second. These are the sample images that I want to format all the same way. You can see that that's my representative image for the template and the data is just a tab delimited text file, saved as something like Word or Excel.

So, here's my Nature Series.txt document. I'm going to open this in a text editor, so you can see what this is all about and create your dataset. You can use something like Excel or Word. All you need is to have a header row, which has the name of your fields for your data. So title, location and the photo are my fields here. The important part is to pay attention to the case-sensitivity. So, if it's uppercase, you're going to need to remember that and that will come into play in a few minutes. Then each row is a record in your dataset and each value is separated by a tab. You notice that the filenames are in the dataset, they correspond to the actual image names that you're going to be applying this variable template to.

To make things easy, I've put all my sample images in the same directory or same location as my template. Let's go see about connecting all this stuff together. So, let's go reopen the Template file in Photoshop and you can see I've got three layers here, a Photo layer, a Location layer and a Title layer and I've named them exactly the same as those field values that I showed in the text file. Again, from Word or Excel, you'd just save your document as what's called a Tab Delimited text file and it just puts a tab between each value and then it puts a carriage return between each record. To set this up, you go to the Image menu and you'd choose Variables > Define and Photoshop says, "Okay, well, I see that you've got some layers here." You've got a little layer list that corresponds to the layers that can become variables inside your document and then it asks you, "Okay, for the Title layer, what kind of variable do you want it to be?" I want it to be a Text Replacement. What's the name of this? Well, I'm going to name it exactly the same as my layer name here and that corresponds to the field name in the dataset.

Once you've bound and told which layer to which kind of replacement it to be, it puts a little asterisk next to it, so we'll go to the next layer. Location, again we want that to be a Text Replacement Variable and we'll make that the location and then finally the Photo layer, we'll have that be a Pixel Replacement and we'll call that Photo and we want it to be best fit with an alignment of center and so forth. Okay, that looks great! Actually I'm going to do a Fill and I'm going to clip it to the bounding box of the layer. So you've got some options of how you want your images to come in if they're different sizes. Okay, so I've done all the association of defining the variables. Now, I need to bind it to the actual data file. So, I've chosen Data Sets here. There's an Import button and I'll click that and navigate to that Tab Delimited text file.

So, I'll click the Select File button and there's my text file that I'm going to load into Photoshop. Go ahead and click OK and you can see now it's starting to populate this document with my sample data. So, instead of just saying Title and Location, now it actually says Majestic Rainier in Medina Park, Bellevue. I can cycle through the different data sets in this document, so here's the next value and if I just wait a split second, it loads that additional image in there and changes the variable data, just like so. So, I can click on the next one as well and I get the next image. Pretty cool, huh? So this is just to preview the data, all right.

When I click OK, it actually just goes back and shows you the template. What you want to do now is process this data set out as individual files and to do that, you go to the File menu and choose Export > Data Sets as Files and that's going to bring up this dialog box where you can choose a location. I'll go ahead and create a folder on the desktop and we'll call it Processed, Create, choose that folder and then you can do a naming scheme for your results. I'll just go in and go with the default but you can type in anything you want and create a name and structure there. And I'll just go ahead and do all the data sets that are in that text file.

I'm going to go ahead and click OK and now I'm going to kick back and watch Photoshop do its thing, while it's automating the production of all these different versions based on that data set. If I navigate back out to my desktop here, you can go and take a look at the Processed folder and there are those five images, all processed as separate files now and if I double-click on one of them, you'll see it got populated with its data. So, there you have it, a killer power shortcut. It does take a little bit of setup, but I encourage you to try this out on your own, because it's an easy way to automate the processing of multiple files.

Format multiple files with a template and variables
Video duration: 5m 26s 6h 21m Intermediate


Format multiple files with a template and variables provides you with in-depth training on Design. Taught by Michael Ninness as part of the Photoshop CS4 Power Shortcuts

Design Photography
please wait ...