What's new
Photoshop Gurus Forum

Welcome to Photoshop Gurus forum. Register a free account today to become a member! It's completely free. Once signed in, you'll enjoy an ad-free experience and be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Reply to thread

[code]

#target photoshop;

if(documents.length){

if (ExternalObject.AdobeXMPScript == undefined) ExternalObject.AdobeXMPScript = new ExternalObject('lib:AdobeXMPScript');

var xmp = new XMPMeta(activeDocument.xmpMetadata.rawData);

if( xmp.doesPropertyExist(XMPConst.NS_XMP, "CreateDate" ) ) {

var date = new Date(new XMPDateTime(xmp.getProperty( XMPConst.NS_XMP, "CreateDate" ).toString()).getDate().getTime());

var m = date.getMonth() + 1;

var month = (m < 10) ? '0' + m : m;

var yy = date.getYear();

var dom = date.getDate();

var dayM = (dom < 10) ? '0' + dom : dom;

var year = (yy < 1000) ? yy + 1900 : yy;

var FontName = "Arial";

var FontSize = 16;

var black = new SolidColor();

black.rgb.hexValue = '000000';

newTextLayer = activeDocument.artLayers.add();

newTextLayer.kind = LayerKind.TEXT;

newTextLayer.textItem.kind = TextType.POINTTEXT

newTextLayer.textItem.color = black;

newTextLayer.textItem.font = FontName;

newTextLayer.textItem.size = FontSize;

newTextLayer.textItem.contents=dayM+"."+month+"."+year;

activeDocument.selection.selectAll();

align('AdRg');

align('AdBt');

activeDocument.selection.deselect();

activeDocument.activeLayer.translate (-10, -10);

}else{

    alert("sorry this document does not have the create date!");

    }

}

function align(method) {

var desc = new ActionDescriptor();

var ref = new ActionReference();

ref.putEnumerated( charIDToTypeID( "Lyr " ), charIDToTypeID( "Ordn" ), charIDToTypeID( "Trgt" ) );

desc.putReference( charIDToTypeID( "null" ), ref );

desc.putEnumerated( charIDToTypeID( "Usng" ), charIDToTypeID( "ADSt" ), charIDToTypeID( method ) );

executeAction( charIDToTypeID( "Algn" ), desc, DialogModes.NO );

};


[/code]


What is our favorite program/app? (Hint - it begins and ends with the letter P)
Back
Top