Copy link to clipboard
Copied
Hi friends! I'm looking for a script that adds to the document a layer of text written with the same characters as the selected layer.
Example:
1-Document with a layer named "Picture_3: Print" selected.
2-run Script:
3 - Add in the document a layer of text written "Picture_3: Print"
Thanks in advance:
Copy link to clipboard
Copied
It look like you actually want a lot more than you wrote to me. I think you want the text to be some size, be some font, aligned to something, and fit. None of which you mentioned.
Copy link to clipboard
Copied
Good points.
What are the exact rules that should determine the position and orientation of the Type Layer?
Copy link to clipboard
Copied
As for position and orientation, you can add at the top, left, then I will edit the positions for each document.
Copy link to clipboard
Copied
Top left now we need to know text size relative to document size and resolution. To know where the bottom left of the text will be relative to the document top left 0,0 X Y point, then there is font.
Why do you want a layer name as a text layer. What are you actually trying to do?
Copy link to clipboard
Copied
The size of A4 Document (21x29.7 cm) with resolution 250 pixels / inch
Source: Arial
Size: 12pt
Black color
Hi JJMack
Why do you want a layer name as a text layer. What do you really want to do?
This was the basis for the identification of the product type to stamp on shirts, cups and other ....
Copy link to clipboard
Copied
Is the document a single layer document multi layered document if it a layered document do you want text layer for each layer or for particular layer types or a particular layers if more the on text layer is to be added should all positions top left.
When you want to automate something in Photoshop you need design the process well.. You are not going to find a script on the web to does exactly what you seem to want to do. You will need to write your own custom script.
Adobe Photoshop Scripting | Adobe Developer Connection
Copy link to clipboard
Copied
This JJMack is a figure! He asks a series of technical questions and does not end the user to become alone ... I was once dismissed in the same way.
Copy link to clipboard
Copied
Hi Ps-Design! this script is a bit like what you need, I believe there is a user exeto the JJMack that I can make a change in some lines of this script to meet your needs. Hope this helps, good luck.
The script will prompt for a text file containing the names.
- #target photoshop;
- if(documents.length) main();
- function main(){
- var txtFile = File.openDialog("Please select TEXT.","TXT File:*.txt");
- var Names = [];
- if(txtFile == null) return;
- txtFile.open('r');
- var data = txtFile.read();
- txtFile.close();
- data = data.split('\n');
- for (var a in data){
- var line = data.replace(/^\s+|\s+$/g);
- if(line.length >3) Names.push(line);
- }
- for(var n in Names){
- createTextLayer(Names
); - }
- };
- function createTextLayer(layerName) {
- var startRulerUnits = app.preferences.rulerUnits;
- app.preferences.rulerUnits = Units.PIXELS;
- var thisLayer = activeDocument.artLayers.add();
- thisLayer.kind = LayerKind.TEXT;
- thisLayer.name = layerName;
- var textProperty = thisLayer.textItem;
- textProperty.kind = TextType.POINTTEXT;
- //Font Size
- textProperty.size = 10;
- textProperty.font = "Arial";
- var newColor = new SolidColor();
- //Font Colour
- newColor.rgb.red = 0;
- newColor.rgb.green = 0;
- newColor.rgb.blue = 0;
- textProperty.color = newColor;
- textProperty.position = new Array( 100,100);
- thisLayer.blendMode = BlendMode.NORMAL;
- thisLayer.opacity = 100;
- textProperty.contents = layerName;
- app.preferences.rulerUnits=startRulerUnits;
- };
Copy link to clipboard
Copied
That script does add a text layer but it not a script the does whet the op wants. They also did not state they knew anything about the scripting knowledge. If the do not know anything about Photoshop scripting the will not be able to understand the code you posted and will not be able to modify it.
Copy link to clipboard
Copied
Hello tokuredit thanks for the help! Great script, however it is critical that the added text layer contain the same characters as the last selected layer, without the need to use external .txt files.