View Full Version : Filename used as text layer I am trying to find a quick batch method to create a text layer with the photo file name. I want to build a DVD proof to add to my slide show. So when I build the DVD slide show of pictures of my kids, the filename will show up on the photo. Which will allow my wife to sit down and decide what photos to order of our kids.
I want to create an action to open the file, create a text layer that includes the filename, resave it in another directory as a jpeg. Thanks VidKid 12-15-2003, 10:47 PM If you have PS 7 or CS(8) the Picture Package will automatically put the filename caption on or below the picture. The size of the font can also be specified.
You could also use the Contact Sheet II which will places the filename caption and is bundled with PS 5.5,6,7,and 8, but I prefer to use Picture Package.
It's handy for customer's proofs and a time saver.
In PS: File>Automate>Picture Package - or- Contact Sheet II
VidKid I have PS 7.0 and I know how to do that, but I want to be able to create a new jpeg file from the original that is saved so I can include all of the edited jpeg's (with filename ) in a DVD slideshow. Then people can view the DVD photo by photo and the filename will be on the proof photo. They will be able to check off a proof listing of all of the photos that they want me to order online. This is a way for my wife to sit down in front of the TV and view each photo. The filename on the photo will allow her to view the photos and not have to mess with the computer. She marks the printed contact sheet cross referenced with the jpeg's that she likes after she has viewed it on the TV.
Thanks Vikki 12-16-2003, 07:21 AM If you have Photoshop7, and the scripting feature, there is a script that will add the filename as a text layer. Let me know if you want the script, and I'll post it. How do use a script file in PS 7.0. I apologize but I am a newcomer to PS and I am hust starting to learn to use actions.
If you could post that script I would appreciate it !
Thanks Vikki 12-16-2003, 11:43 AM First thing you need to do is go to Adobe's website, and download the "Scripting" addin.
I will post the file later tonight. Vikki 12-16-2003, 09:23 PM Once you install the scripting plugin, follow these steps:
Download this script and save it to a folder. (I created a subfolder under Photoshop called Scripts).
Open Photoshop
Open a file (this script works on the active document.)
Select from the main menu: File>Automate>Scripts> "browse" to the folder where you saved the script, and select it.
It puts the file name in the lower right corner, in red texts.
You can edit the file with notepad to change the color, or position.
If you know how to write javascript, you can edit this, and add batch capabilities. Vikki 12-16-2003, 09:32 PM oops, forgot the attachment.
I had to zip this, so it must be "unzipped" before you can use it. Vikki,
Thanks for all of your effort ! I have searched for the scripting plugin at Adobe with no luck. Any suggestions ? Vikki 12-17-2003, 06:08 PM Here is the link to the Windows version:
http://graphicssoft.about.com/gi/dynamic/offsite.htm?site=http%3A%2F%2Fwww.adobe.com%2Fsupport%2Fdownloads%2Fdetail.jsp%3FftpID%3D1536
Here is the link to the MAC version:
http://graphicssoft.about.com/gi/dynamic/offsite.htm?site=http%3A%2F%2Fwww.adobe.com%2Fsupport%2Fdownloads%2Fdetail.jsp%3FftpID%3D1535 Vikki,
Thanks ! It works like a charm. Happy Holidays ! Vikki 12-17-2003, 06:46 PM Great!
Happy Holidays to you too. Thanks for posting that Vikki. I decided to try it out, and it's easy enough for me, so anyone can do it! :)
Ed ilesh@ileshshah 03-17-2004, 11:19 AM can you please email me the script at ilesh@ileshshah.com
Thanks in advance... Vikki 03-17-2004, 11:51 AM You can download the script from here. It's posted as a zip file a few threads down on this page.
http://www.retouchpro.com/forums/attachment.php?attachmentid=11109 JovaniMF 03-22-2004, 03:19 PM Thanks for your help, you save my life and my time.
Juan rd1769 06-18-2004, 09:20 PM Hi......THANKS for the info and the script.
How can you batch it so you can put them on all the pictures in a file? I tried making an action and batching but it didnt work. T Paul 06-19-2004, 09:09 AM Check out this thread:
How to Batch Rename Files in Photoshop (http://www.mediacollege.com/graphics/photoshop/batch-rename.html) 7
Summary:
Using the Photoshop File Browser, open the folder containing the files and select the ones you wish to rename.
Right-click on any of the selected images and click Batch Rename from the context menu. This will open a new window.
Choose to rename the files in the same folder or move them to a new folder.
The File Naming section is where you specify how the files will be named. There are six drop menus and the contents of each one are added together to make the name. The idea is that at least one of the menus (i.e. one part of the file name) will create sequential numbers or letters.
Here are a few other links:
How To Rename a Series of Files With Adobe Photoshop or Photoshop Elements (http://graphicssoft.about.com/cs/renamers/ht/apsrename.htm)
Photoshop 7: Batch Processing with actions (http://www.cbtcafe.com/photoshop/batch/batch.html) rd1769 06-19-2004, 09:33 AM Thanks but that one Iknow of. I would like to use the script to put the img number on the front of all in a folder instead of doing one at a time. rd1769 06-19-2004, 09:51 AM Ok, here is what I did and it works. First i loaded the script, downloaded from above, into the presets. (I then deleted the other presets - cause i didnt want to use them). Then it was a simple matter of setting up an action and with the script in the presets it worked fine. Placed the img number on all in the file. Gotta love this forum! DannyRaphael 06-19-2004, 10:11 AM Richard. You beat me to it. Glad you got it figured out.
For the benefit of others, here's a detailed "how to"...
INSTALL THE SCRIPT
1. Download the plugin
2. Unzip
3. Copy the JavaScript (.js) file to:
C:\Program Files\Adobe\Photoshop 7.0\Presets\Scripts
...or the PS CS equivalent.
TEST THE SCRIPT
1. Open a test image
2. Image > Duplicate. You don't want to "practice" on an original.
3. Close the original. Further safety.
4. File > Automate > Scripts... Choose "Add FileName" and click Run Script
5. Inspect the results. Note: The script added a text layer and then flattened the image.
6. File > Close the test image without saving
7. If you like what you see, go to WRITE THE ACTION
TO MODIFY THE SCRIPT
If you want to change the font, size or color, you can do this by modifying the script.
1. Right-click on [color=blue]Add FileName.js[/i] and choose Edit from the menu.
2. Change the RGB values to suit (RGB= 255,0,0 = Red).
3. In myTextRef.size = 24; -- replace 24 with desired font size
4. In myTextRef.font = "Arial"; -- replace Arial with desired font style
5. If you want to alter the position of the text, modify this statement:
// myTextRef.position = new Array( 98,98 );
The first 98 = "The bottom of the text will be placed on a horizontal line 98% from the top of the image, that is, 2% above the bottom of the image."
The 2nd 98 = "The last character in the text (RIGHT justified) will be placed against a vertical line that's 98% from the left edge, that is almost to the right edge of the image."
6. File > Save
7. It's always a good idea to test the changed script just to be sure it still works. (See TEST THE SCRIPT above.)
WRITE THE ACTION
1. Open a test image
2. Image > Duplicate. You don't want to "practice" on an original.
3. Close the original. Further safety.
4. Click the CREATE NEW ACTION buttom at the bottom of the Actions Palette. Assign an action name and click Record.
5. File > Automate > Scripts...
6. Choose "Add FileName" and click Run Script
7. File > Save as... (chose file format, even if you're not changing file formate), do NOT change File Name, and identify ANY folder or Desktop. It makes no difference which you choose.
8. When you click OK, you may get an additional dialog box for, say, .jpg options. If you do, choose the options and click OK.
9. Click the STOP RECORDING button at the bottom of the Actions Palette.
10. File > Close the test image without saving
PROCESS A BATCH OF IMAGES
1. If you haven't yet, create a folder where processed images will be placed. (\Destination)
2. File > Automate > Batch
3. Action set and Action should be populated with the new action.
4. Source: Folder. Choose (navigate to the folder where the images to be processed reside)
5. Destionation: Folder. Choose (navigate to \Destination) where the processed images will be saved. This overrides what was recorded in the File > Save As... dialog.
6. IMPORTANT: Click ON the "Bypass Action 'Save as' Commands." If you don't, you will have to reply to a dialog box for each image processed, not good for "hands off" automation.
7. Click OK. That should initiate the action, apply it to the source images and put the processed images in \Destination.
I'm pretty sure I caught everything here, but if you run into any problems or have questions, don't hesitate to ask.
Happy batching.
~Danny~ rd1769 06-19-2004, 10:20 AM THANKS! Your detailed message sure put mine to shame LOL! :cold: DannyRaphael 06-19-2004, 10:27 AM THANKS! Your detailed message sure put mine to shame LOL!
I sure wasn't trying to outgun you or show you up, Richard, believe me. There are lots of folks who have very little, if any, action, batch processing or scripting experience. All the gory details were for as much their benefit as mine, since I'd not looked into this script before.
VIKKI: Great script. Meant to thank you for crafting/posting it in the previous message.
~Danny~ rd1769 06-19-2004, 10:31 AM My comment was in no way meant to be a slam..... You did a great job and I appreciate it. Just making funny. DannyRaphael 06-19-2004, 12:13 PM No problem... It wasn't taken as a slam; I just didn't want you to feel like you were being upstaged. All is OK. :) jrphoto 07-03-2004, 02:00 PM I have been trying to figure out how to get rid of the file name extension. Any suggestions or link to a tutorial?
Joel DannyRaphael 07-03-2004, 04:46 PM Hi Joel:
Welcome to RetouchPRO. You will need to modify (add a line) to the script. Here's how to do it:
After downloading the script into
C:\Program Files\Adobe\Photoshop 7.0\Presets\Scripts
(or your equivalent),
right-click on the file name and choose edit.
After this line:
myTextRef.contents = docRef.name;
Insert (copy/paste) this line:
myTextRef.contents = myTextRef.contents.substring(0,(myTextRef.contents.length-4));
What this line does is strip off the last four characters of the file name, that is, the period and three character extension.
After you save the updated script, you should be good to either invoke the script directly from the Automation > Scripts dialog or record an action that invokes the script. Then the action can be invoke through Automation > Batch dialog.
HTH...
~Danny~ jrphoto 07-03-2004, 06:30 PM Thank you Danny for your repsonse and the info.
It worked great. I am now trying to put my copyright and name in the left corner. If I copied and paste the exisiting script below the one that is there. How would I change the line to add the name? Better yet could you recommend a good tutorial on how to make these scripts? I know nothing about them.
What I want to achieve is something like the image attached. I created an action to increase the canvas size and then run the script to put the name on the border.
Joel DannyRaphael 07-03-2004, 08:11 PM Thank you Danny for your repsonse and the info.
It worked great. I am now trying to put my copyright and name in the left corner. If I copied and paste the exisiting script below the one that is there. How would I change the line to add the name? Better yet could you recommend a good tutorial on how to make these scripts? I know nothing about them.
What I want to achieve is something like the image attached. I created an action to increase the canvas size and then run the script to put the name on the border.
Joel
Hi again... Glad round 1 worked. More code splicing... (see blue below).
Your example pic was pretty small, so I couldn't see exactly how you formatted the copyright text. Before you copy/paste, you'll want to replace
©2004 - J.R.Photography
below with whatever text you like. Be sure to NOT delete the single quote marks at each end of the text string. If you do, the script will fail.
==========================
// Position file name in bottom righ corner
myTextRef.position = new Array( 98,98 );
- - - - - - - START OF NEW TEXT - - - - -
// *******
// Create a layer for the copyright text
// *******
var nameLayerRef = docRef.artLayers.add();
nameLayerRef.kind = LayerKind.TEXT;
nameLayerRef.name = "Copyright text";
var myTextRef = nameLayerRef.textItem;
myTextRef.color = myColor;
myTextRef.contents = '©2004 - J.R.Photography';
myTextRef.size = 24;
myTextRef.font = "Arial";
myTextRef.justification=Justification.LEFT;
// Position photographer ID text at left, bottom
myTextRef.position = new Array( 2,98 );
- - - - - - - END OF NEW TEXT - - - - -
// Flatten Layers
==========================
Full disclosure. In another lifetime I did a fair amount of computer programming, which is somewhat like auto mechanics. If you have experience working on Fords, you have a pretty good chance of being able to figure out Chevys if you have access to a couple Chevrolet tech manuals.
Although I've barely touched JavaScript, I was able to hack some code that works. In this case I was lucky: my past experience was what got me by.
An experineced JavaScript programmer would be able to achieve the results more efficiently, but functionally this works. Think of what I did as you would a backyard auto mechanic working on your car. At least the steering wheel didn't fall off. :nod:
re: Better yet could you recommend a good tutorial on how to make these scripts? I know nothing about them.
So, learning to write scripts is not something one could ever learn from a tutorial. Like learning auto mechanics, it's more like a couple quarters (or maybe more) of community college-type classes in programming to really get your arms around the concepts and fundamental skills. It takes a fair amount of time, effort and practice to become moderately proficient. That's not to say you couldn't do it, because if you can figure out photography and start your own business, you have the drive to succeed and the smarts to figure it out.
If you do a Google search on JavaScript, you'll have enough to read until at least Thursday. :)
Anyway, it was fun (for me) to tackle this. I learned a few things today myself.
~Danny~ jrphoto 07-04-2004, 01:10 PM Thanks alot . It works like a charm.
Joel jminer 09-06-2004, 09:53 AM This thread was extremely helpful to me in processing a large number of photos. Excellent descriptions.
One question: is there a way to add a colored (black) background to the text box that surrounds the red letters? sometimes photos have varied colors that makes it difficult to read the filename. I looked around and saw commands like "background-color #000000;, but couldnt get the syntax right.
Let me know if this is possible.
thanks
Jminer DannyRaphael 09-06-2004, 10:56 AM This thread was extremely helpful to me in processing a large number of photos. Excellent descriptions.
One question: is there a way to add a colored (black) background to the text box that surrounds the red letters? sometimes photos have varied colors that makes it difficult to read the filename. I looked around and saw commands like "background-color #000000;, but couldnt get the syntax right.
Let me know if this is possible.
thanks
Jminer
Glad you found this useful. Me too. I can barely spell "scripting" and it gave me an opportunity to learn something.
re:"One question: is there a way to add a colored (black) background to the text box that surrounds the red letters?"
I'm sure there's a way to script this, but this may be a whole lot easier if time is of the essence: Following the command in the action that calls the script I would record the application of a Layer Style to the Text layer where effects such as Stroke (using a contrasting color) and perhaps others if needed are applied to make the text stand out regardless of image.
Would this get you anywhere?
~Danny~ jminer 09-06-2004, 09:52 PM Danny,
I am almost there. I recorded an action in photoshop that runs before the filename. it copies the picture, then enlarges the canvas, then creates a new black layer then pastes the picture on top, then runs the filename script.
this works really well. except that my canvas enlargement defaults to the "from the center" setting in stead of "from the top center". I dont understand why this is. it even says top in the description of the action.
Any idea why the action defaults to the center? It works correctly when I record it.
This is photoshop, not scripting.
Jminer jminer 09-06-2004, 10:22 PM the solution was to change the background color to black (duh!) and enlarge the canvas. then run the script. I packed it all away in a droplet and will be converting a few hundred photos with this trick.
thanks much!
Jminer One question: is there a way to add a colored (black) background to the text box that surrounds the red letters?
OK, I´m on it....
the solution was ..........
Oops, maybe too late.
You should find below a "Version 2.0" of AddFileName. Besides some general (internal) housekeeping chores, I put in the background behind the text. Also you can now choose the colors :happy: - the text and background will be in the foreground / background colors of PS. Default <D> will be black text on white background, but you can probably think of something much better. :cool:
I think that the size of the text could vary with the size of the image .. but that's something for tomorrow.
...you have a pretty good chance of being able to figure out Chevys if you have access to a couple Chevrolet tech manuals.
I do quite a bit of work in VBasic (Access), writing JavaScript is like being on vaction. Concise, direct and no fussing => fun!
Roland DannyRaphael 09-08-2004, 05:43 AM OK, I´m on it....
Ro... you da man. It's never too late to make code enhancements.
You just elevated yourself to "My JS hero!"
Well done and greatly appreciated.
- - - - - -
Jminer: Glad you came up with a creative solution. Way to go. yann_ 03-21-2005, 12:33 PM I've just found the forum while looking for information about filename text layers and found this really interesting thread :pleased: . Even if not active now I though it was the best place to post my question:
How can I create a layer displaying the DATE when the picture was taken instead of the filename? Any ideas appreciated.
Thanks DannyRaphael 03-21-2005, 03:41 PM I've just found the forum while looking for information about filename text layers and found this really interesting thread :pleased: . Even if not active now I though it was the best place to post my question:
How can I create a layer displaying the DATE when the picture was taken instead of the filename? Any ideas appreciated.
Thanks
Welcome, Yann...
It seems like this should not be a difficult thing to script, but I did not have a lot of success finding script examples.
How are your VBA or Java scripting skills? If strong, the following information may be helpful:
http://www.shotgraph.com/script_photo_src.htm
http://www.adobeforums.com/cgi-bin/webx?128@953.ENpiduG2464.8@.3bb6ddf3
If you don't have strong scripting skills (I certainly do not), look into a program called Exifer (click HERE (http://www.friedemann-schmidt.com/software/exifer/)). It looks promising.
~Danny~ sulrich 04-28-2005, 04:06 PM I am trying to add the filename to may photos using the scripting function. I have gotten as far as downloading the file from Adobe and installing it on my computer, however, when I attempt to use it in Photoshop>Automate>Scripting...there is nothing that says AddFileName. I only have a few options like Color Match, AdjustLevels etc., I'm pretty sure it's installed right.
Any advice for Mac users?
Thanks DannyRaphael 04-28-2005, 06:27 PM I am trying to add the filename to may photos using the scripting function. I have gotten as far as downloading the file from Adobe and installing it on my computer, however, when I attempt to use it in Photoshop>Automate>Scripting...there is nothing that says AddFileName. I only have a few options like Color Match, AdjustLevels etc., I'm pretty sure it's installed right.
Any advice for Mac users?
Thanks
Gemerally speaking MacOS doesn't need file name extensions like Windows does, but Mac/PS has this requirement for some file types. So the following is a shot in the dark...
Open the folder that contains the Color Match, AdjustLevels, etc. script files -- the ones that show up in the Scripts menu.
Do their file names end with ".js"? If true and the file you downloaded from Adobe does not, change its file name accordingly. dragin 01-15-2006, 11:05 AM I have been reading your postings dealing with AddFilename Script. I am working on a large project (about 3000 photos) for a family dvd. I am just learning about scripting in Photoshop. I bought a book on JavaScript and am beginning to teach myself the code. My question is, is there a way to fit lots of text onto a photo with this script. I have edited the current script to get rid of everything but the filename (which is the text i want displayed on the screen). The problem is, if there is more than 5-6 words than the rest is lost off the edge of the photo. I have some photos that have 10-15 words in the filename. I am using a font size of 8. Any suggestions would be greatly appreciated. Welcome to RetouchPRO, dragin. :bigthmb:
OK, gimme a couple of minutes and I'll fix something up.
Rô OK, here you go.
Passed the text to the left side. Now you can occupy the whole width of the image.
Rô dragin 01-15-2006, 12:24 PM Ro,
Thanks for that information. You didn't waste any time. If the text will not fit on the photo in one line, can the text be wrapped around and placed below the beginning text, or do I need to shorten the filename and include only the most relevant information. Here is an example of a photo just to give you a illustration: Hazel, Loretta, Mary (holding Wade), Jenny, Cody, Denzil, and Blanche Agin
Thanks again for your insight.
D.R. DannyRaphael 01-15-2006, 01:41 PM This would take a little programming, but I'm pretty sure it could be done by doing something like the following:
* Determine the file name length
* If longer than XX characters (XX = max width), then parse the file name string until you find the first "space" character before the XX max length and replace it with a <cr> (carriage return) character. This would be the equivalent of pressing Enter in the text dialog to get a new line.
Ro - you up to another tweak? :) OK, here we go....
But, to make sure thing fit in, you may have to edit the script a little, I left the variables at the top of the script.
Don't worry just open with (if using PC) Notepad (not Word) and change the numbers.
var pxSTART_VERT = 90; //Starting height in percent of total height
var inTEXT_SIZE = 12; //Font size
In this case the text starts at 90% of the way down, with font size 12.
Attached are some alternatives using different settings.
Rô | |