var docRef = activeDocument;
// Now create a text layer at the front var myLayerRef = docRef.artLayers.add(); //myLayerRef.rotate (180) myLayerRef.kind = LayerKind.TEXT; myLayerRef.name = "Filename"; var myTextRef = myLayerRef.textItem; // strip the extension off var fileNameNoExtension = docRef.name; fileNameNoExtension = fileNameNoExtension.split( "." ); if ( fileNameNoExtension.length > 1 ) { fileNameNoExtension.length--; } fileNameNoExtension = fileNameNoExtension.join("."); myTextRef.contents = tempName[5]; // off set the text to be in the middle myTextRef.position = new Array( docRef.width / 2, docRef.height / 2 ); myTextRef.size = Number(tempName[7]); myTextRef.font=tempName[6]; //myTextRef.underline.UnderlineType.UNDERLINELEFT; //set position of text LINE NO 221 myTextRef.justification = Justification.CENTER; myTextRef.kind = TextType.PARAGRAPHTEXT; myTextRef.width= docRef.width; myTextRef.height= docRef.height/ 2; myTextRef.position= [Number(tempName[1]), Number(tempName[2])]; ////////////////////// CODE TO ADD TEXT IN LAYER ENDS /////////////////////////
|
|
No comments:
Post a Comment