Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
4

Separate Layer for each Line of Text

Mentor ,
Feb 05, 2024 Feb 05, 2024

In this all four text are in one layer. Is there any tool to separte this four text into each separte layer? That means one text is in one layer.  Four texts are in four separate layers independently

 

2024-02-05_12-59-22.pngexpand image

 

 

TOPICS
Windows
572
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
LEGEND ,
Feb 05, 2024 Feb 05, 2024

So your original has one text layer with four lines?

You can use a script to separate these out. These are the basic steps.

try{
    var docRef = app.activeDocument;
    var LayerRef = docRef.activeLayer;
    if(LayerRef.kind == LayerKind.TEXT){
        var LayerText = LayerRef.textItem.contents;
        LayerText = LayerText.split('\r');
        LayerRef.remove();
        for(var i = 0; i < LayerText.length; i++){
            LayerRef = docRef.artLayers.add();
            LayerRef.kind = LayerKind.TEXT;
            TextRef = LayerRef.textItem;
            TextRef.contents = LayerText[i];
            }
        }
    }
catch(e){
    Window.alert(e + ' ' + e.line);
    }

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 05, 2024 Feb 05, 2024

@Lumigraphics â€“ Nice!

 

Now, we both know what the follow-up question is!  :]

 

https://exchange.adobe.com/apps/cc/57bb5a8e/split-rows-for-ps

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Feb 06, 2024 Feb 06, 2024

Thanks for the reply. This seems a program. I do not know how to use this. If it is frequently used in Ps I am prepared to learn this. Anyway I solved this problem by writing each text in four separate layer.

 

But if it is a very long text it is tedious to make many separate layer, in such a case program is useful. 

 

What I was looking for was any tool or command to make one long sentence in one layer into each text in many layers.   

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 06, 2024 Feb 06, 2024

That's what the code from @Lumigraphics does.

 

Same for the extension in the link in my post.


The code is ExtendScript, to be saved as a plain text file with a .jsx extension. More here:

 

https://prepression.blogspot.com/2017/11/downloading-and-installing-adobe-scripts.html

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Feb 07, 2024 Feb 07, 2024

Thanks for the information. I wish to know whether ExtendScript is a Java program. 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 07, 2024 Feb 07, 2024

MahaB82A wrote:

Thanks for the information. I wish to know whether ExtendScript is a Java program. 



An extended/custom form of an old JavaScript language version, not Java program code which is something totally different.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Feb 07, 2024 Feb 07, 2024

Is this a separate language or codes to add to Ps to get desired result?  

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 07, 2024 Feb 07, 2024

MahaB82A wrote:

Is this a separate language or codes to add to Ps to get desired result?  


 

Both!

 

https://prepression.blogspot.com/2017/11/downloading-and-installing-adobe-scripts.html

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Feb 07, 2024 Feb 07, 2024

If it is a separate language I am willing to learn then I can understand the codes added to Ps. Is this codes can be added to other adobe apps [Pr, Ae and Ai]?

 

Do you know any resources where I can learn this language from scratch?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 07, 2024 Feb 07, 2024
LATEST

https://developer.adobe.com/photoshop/

Adobe currently has four frameworks to automate Photoshop.

- Extendscript/ScriptUI

- C++

- CEP

- UXP

 

And yes, other apps such as Illustrator, InDesign, Acrobat, Bridge, Premiere Pro are also scriptable.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 07, 2024 Feb 07, 2024

What I posted is just a basic outline of what is possible. You could add text formatting, conditions, layer naming, text replacement, all sorts of goodies to that script snippet.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines