RetouchPRO

Go Back   RetouchPRO > Tools > Software
Register Blogs FAQ Site Nav Search Today's Posts Mark Forums Read


Software Photoshop, Lightroom, Paintshop Pro, Painter, etc., and all their various plugins. Of course, you can also discuss all other programs, as well.

Filename used as text layer

Reply
 
Thread Tools
  #21  
Old 06-19-2004, 11:11 AM
DannyRaphael's Avatar
DannyRaphael DannyRaphael is offline
Moderator
 
Join Date: Mar 2002
Location: Near Seattle, Washington, USA
Posts: 6,300
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~
Reply With Quote top
  #22  
Old 06-19-2004, 11:20 AM
rd1769 rd1769 is offline
Junior Member
 
Join Date: Jun 2004
Posts: 5
Detailed

THANKS! Your detailed message sure put mine to shame LOL!
Reply With Quote top
  #23  
Old 06-19-2004, 11:27 AM
DannyRaphael's Avatar
DannyRaphael DannyRaphael is offline
Moderator
 
Join Date: Mar 2002
Location: Near Seattle, Washington, USA
Posts: 6,300
Quote:
Originally Posted by rd1769
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~
Reply With Quote top
  #24  
Old 06-19-2004, 11:31 AM
rd1769 rd1769 is offline
Junior Member
 
Join Date: Jun 2004
Posts: 5
No Problem

My comment was in no way meant to be a slam..... You did a great job and I appreciate it. Just making funny.
Reply With Quote top
  #25  
Old 06-19-2004, 01:13 PM
DannyRaphael's Avatar
DannyRaphael DannyRaphael is offline
Moderator
 
Join Date: Mar 2002
Location: Near Seattle, Washington, USA
Posts: 6,300
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.
Reply With Quote top
  #26  
Old 07-03-2004, 03:00 PM
jrphoto jrphoto is offline
Junior Member
 
Join Date: Oct 2003
Posts: 3
I have been trying to figure out how to get rid of the file name extension. Any suggestions or link to a tutorial?

Joel
Reply With Quote top
  #27  
Old 07-03-2004, 05:46 PM
DannyRaphael's Avatar
DannyRaphael DannyRaphael is offline
Moderator
 
Join Date: Mar 2002
Location: Near Seattle, Washington, USA
Posts: 6,300
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~
Reply With Quote top
  #28  
Old 07-03-2004, 07:30 PM
jrphoto jrphoto is offline
Junior Member
 
Join Date: Oct 2003
Posts: 3
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
Attached Images
File Type: jpg IMG_7741.jpg (71.7 KB, 22 views)
Reply With Quote top
  #29  
Old 07-03-2004, 09:11 PM
DannyRaphael's Avatar
DannyRaphael DannyRaphael is offline
Moderator
 
Join Date: Mar 2002
Location: Near Seattle, Washington, USA
Posts: 6,300
Quote:
Originally Posted by jrphoto
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.

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~
Reply With Quote top
  #30  
Old 07-04-2004, 02:10 PM
jrphoto jrphoto is offline
Junior Member
 
Join Date: Oct 2003
Posts: 3
Thanks alot . It works like a charm.

Joel
Reply With Quote top
Reply

  RetouchPRO > Tools > Software


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Tutorial 05: Converting a Color Image to Black and White grayscale BW DannyRaphael Photo-Art 101 17 05-22-2011 05:55 PM
help with german Photoshop commands please pure Photoshop Help 9 06-21-2010 03:33 PM
select shape Peg Hidden Power Support 7 08-29-2004 07:10 PM
Help needed understanding these layers. peejay Photo-Based Art 3 01-16-2004 09:15 PM
Screen, Multiply Explained... dpnew Hidden Power Support 3 12-28-2003 12:46 PM


All times are GMT -6. The time now is 03:57 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
Copyright © 2016 Doug Nelson. All Rights Reserved