Getting File Name to Appear as pixels in the image

JD
Posted By
Jason_De_Donno
Aug 27, 2004
Views
316
Replies
6
Status
Closed
Is there any way I can get the file name of a raster image (say, BMP) to appear in the image as part of the image?

How to Improve Photoshop Performance

Learn how to optimize Photoshop for maximum speed, troubleshoot common issues, and keep your projects organized so that you can work faster than ever before!

TM
Trevor_Morris
Aug 27, 2004
Yes, there is a script that ships with Photoshop CS (installed by default) that does just that. Choose File, Scripts, Add File Name. Voila!
JD
Jason_De_Donno
Aug 30, 2004
Sounds great Trevor thanks! But I couldn’t see this script in the scripts menu, as shown. I also looked around in the PS folders but still couldn’t find it. I’m using a Swedish verison, so perhaps that is the reason.
TM
Trevor_Morris
Aug 30, 2004
Hmmm…maybe it did not come with Photoshop. Here is the script:

// this script is a variation of the script addTimeStamp.js that is installed with PH7

if ( documents.length > 0 )
{
var originalRulerUnits = preferences.rulerUnits;
preferences.rulerUnits = Units.PIXELS;

try
{
var docRef = activeDocument;

// Now create a text layer at the front
var myLayerRef = docRef.artLayers.add();
myLayerRef.kind = LayerKind.TEXT;
myLayerRef.name = "Filename";

var myTextRef = myLayerRef.textItem;
myTextRef.contents = docRef.name;

// off set the text to be in the top left corner
myTextRef.position = new Array( 12, 20 );
}
catch( e )
{
// An error occurred. Restore ruler units, then propagate the error back // to the user
preferences.rulerUnits = originalRulerUnits;
throw e;
}

// Everything went Ok. Restore ruler units
preferences.rulerUnits = originalRulerUnits;
}
else
{
alert( "You must have a document open to add the filename!" ); }
PH
Photo_Help
Aug 30, 2004
Trevor,

You must have installed it yourself at some point.

Jason,

Here is a free script you can download. Add FileName Plus < http://share.studio.adobe.com/axAssetDetailSubmit.asp?aID=10 591&back=http%3A%2F%2Fshare%2Estudio%2Eadobe%2Ecom%2FaxB rowseSubmit%2Easp%3Ft%3D74>
TM
Trevor_Morris
Aug 31, 2004
Thanks PH. I even checked for comments to see where it had come from, but the Author didn’t include any.
PH
Photo_Help
Aug 31, 2004
Trevor,

NP. Maybe it was the Photoshop elves.

How to Master Sharpening in Photoshop

Give your photos a professional finish with sharpening in Photoshop. Learn to enhance details, create contrast, and prepare your images for print, web, and social media.

Related Discussion Topics

Nice and short text about related topics in discussion sections