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!" );
}
Insert the line
app.displayDialogs = DialogModes.ERROR;
at the start of the Script.