Copy link to clipboard
Copied
Hello,
I am using combination of Adobe Bridge and Adobe Photoshop actions in order to batch print multiple image files. How do i modify the scripted actions (via rec function) to get the name of the image file in corner of every printed paper so i know how it is each document called without manually editing every image and write in corner of picture the name by myself ?
This is beyond an action, you need a script for this task.
If you search the forum for filename watermarking scripts, you will find more than one option. Chances are they will need editing for your specific requirements, or perhaps you can add extra steps into your action to edit the text layer.
Here is one example:
...
Insert the line
app.displayDialogs = DialogModes.ERROR;
at the start of the Script.
Copy link to clipboard
Copied
This is beyond an action, you need a script for this task.
If you search the forum for filename watermarking scripts, you will find more than one option. Chances are they will need editing for your specific requirements, or perhaps you can add extra steps into your action to edit the text layer.
Here is one example:
Copy link to clipboard
Copied
You helped me so much ! Thank you.
Copy link to clipboard
Copied
You're welcome, so you are all sorted?
Copy link to clipboard
Copied
Well not quite. I am using the script down below. I included this script in actions with other commands and it works very well if i play the actions in photoshop. Problem comes when i try use those actions which include this script in batch process from adobe bridge. When i start batch processing than with each image file i try to edit with those actions the preferences window comes up and than it wants from me to click through every step of add naming and positioning layers of things which the script is doing with recorded positioning movements.
Do you know any fix which could help me sort this out? I can not work without batch processing.
Thank you.
//Check if a document is open
if ( documents.length > 0 )
{
var originalRulerUnits = preferences.rulerUnits;
preferences.rulerUnits = Units.PERCENT;
try
{
var docRef = activeDocument;
// Create a text layer at the front
var myLayerRef = docRef.artLayers.add();
myLayerRef.kind = LayerKind.TEXT;
myLayerRef.name = "Filename";
var myTextRef = myLayerRef.textItem;
//Set your parameters below this line
var TextBefore = "Reference No:";
var TextAfter = "_";
// Set font size in Points
myTextRef.size = 10;
//Set font - use GetFontName.js to get exact name
myTextRef.font = "ComicSansMS";
//Set text colour in RGB values
var newColor = new SolidColor();
newColor.rgb.red = 0;
newColor.rgb.green = 0;
newColor.rgb.blue = 0;
myTextRef.color = newColor;
// Set the position of the text - percentages from left first, then from top.
myTextRef.position = new Array( 2, 98);
// Set the Blend Mode of the Text Layer. The name must be in CAPITALS - ie change NORMAL to DIFFERENCE.
myLayerRef.blendMode = BlendMode.NORMAL;
// select opacity in percentage
myLayerRef.opacity = 100;
// The following code strips the extension and writes the text layer. fname = file name only
di=(docRef.name).indexOf(".");
fname = (docRef.name).substr(0, di);
//use extension if set
if ( ShowExtension == "y" )
{
fname = docRef.name
}
myTextRef.contents = TextBefore + " " + fname + " " + TextAfter;
}
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!" );
}
Copy link to clipboard
Copied
Insert the line
app.displayDialogs = DialogModes.ERROR;
at the start of the Script.
Copy link to clipboard
Copied
What a magical piece of code. It is working now! Thank you so much!!