//TEXT works best @ 72 PPI
if(documents.length){
app.activeDocument.suspendHistory('Watermark', 'main()');
}
function main(){
app.displayDialogs = DialogModes.NO;
/////////////////////////////// Alter to suit ////////////////////////
var FontName = "Arial"; //Must be postscript name of font!
var FontSize = 14;
var BorderWidth = 8;
var BorderBottom = 25; //This is additional to the BorderWidth!
//////////////////////////////////////////////////////////////////
var black = new SolidColor();
black.rgb.hexValue = '000000';
var white = new SolidColor();
white.rgb.hexValue = 'ffffff';
var startRulerUnits = app.preferences.rulerUnits;
app.preferences.rulerUnits = Units.PIXELS;
///////////// Alter to suit ////////////////////////
fitImage(600,72); //Longest size in pixels
////////////////////////////////////////////////////////////////////////////
activeDocument.flatten();
app.backgroundColor = white;
app.activeDocument.resizeCanvas(activeDocument.width.value + 2, activeDocument.height.value +2, AnchorPosition.MIDDLECENTER);
app.backgroundColor = black;
app.activeDocument.resizeCanvas(activeDocument.width.value + (BorderWidth*2), activeDocument.height.value +( BorderWidth*2), AnchorPosition.MIDDLECENTER);
app.activeDocument.resizeCanvas(activeDocument.width.value, activeDocument.height.value + BorderBottom, AnchorPosition.TOPCENTER);
var newTextLayer = activeDocument.artLayers.add();
newTextLayer.kind = LayerKind.TEXT;
newTextLayer.textItem.kind = TextType.POINTTEXT
newTextLayer.textItem.color = white;
newTextLayer.textItem.font = FontName;
newTextLayer.textItem.size = FontSize;
var Author = activeDocument.info.author;
///////////// Alter to suit ////////////////////////
if (Author == '') Author = "Your Name Goes Here";
////////////////////////////////////////////////////////////////////////////
var Name = decodeURI(activeDocument.name).replace(/\.[^\.]+$/, '');
newTextLayer.textItem.contents =Name + " - " + Author;
newTextLayer.textItem.kind = TextType.PARAGRAPHTEXT;
newTextLayer.textItem.height = FontSize+15;
newTextLayer.textItem.width = activeDocument.width.value-(BorderWidth*2);
newTextLayer.textItem.position = Array(BorderWidth, activeDocument.height.value - (BorderBottom));
newTextLayer.textItem.justification=Justification.CENTERJUSTIFIED;
activeDocument.flatten();
activeDocument.selection.selectAll();
activeDocument.selection.stroke(white, 1, StrokeLocation.INSIDE);
activeDocument.selection.deselect();
app.preferences.rulerUnits = startRulerUnits;
}
function fitImage(newImgSize,res) {
var doc = app.activeDocument;
if (res == undefined) res = undefined;
if (doc.width > doc.height) {
doc.resizeImage(new UnitValue(newImgSize,'px'), undefined, res, ResampleMethod.BICUBIC);
} else
if (doc.width < doc.height) {
doc.resizeImage(undefined, new UnitValue(newImgSize,'px'), res, ResampleMethod.BICUBIC);
} else
if (doc.width == doc.height) {
doc.resizeImage(new UnitValue(newImgSize,'px'), new UnitValue(newImgSize,'px'), res, ResampleMethod.BICUBIC);
}
};