var fullName = "Wojciech Zachwieja"; var date = new Date(); var d = date.getDate(); var day = (d < 10) ? '0' + d : d; var m = date.getMonth() + 1; var month = (m < 10) ? '0' + m : m; var yy = date.getYear(); var year = (yy < 1000) ? yy + 1900 : yy; var content = fullName + " , " + day + '-' + month + '-' + year; createText(42, content) activeDocument.activeLayer.name = "Text"; activeDocument.activeLayer.textItem.justification = Justification.CENTER; function createText(size, content) { // Add a new layer in the new document var artLayerRef = app.activeDocument.artLayers.add(); // Specify that the layer is a text layer artLayerRef.kind = LayerKind.TEXT; //This section defines the color of the hello world text // textColor = new SolidColor(); // textColor.rgb.red = 0; // textColor.rgb.green = 0; // textColor.rgb.blue = 0; //Get a reference to the text item so that we can add the text and format it a bit textItemRef = artLayerRef.textItem textItemRef.contents = content; // textItemRef.color = textColor; // textItemRef.size = size; textItemRef.position = new Array(15, 10); //pixels from the left, pixels from the top }