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

Script for annotating layer objects

Explorer ,
Jan 29, 2021 Jan 29, 2021

Hello all. I'd like to know if it is technically possible to do this by script:

The steps: 

1)Script run through all layers. Pick the first character of each layer

2)Create one text layer for each layer in a separated group with that first character (in the example case it's a number, on yellow markings)

3)Make sure the text isn't necessarily centered on the object (red dot on boundary blue) but touching an area with solid pixels of that layer.

numbering_annotated.jpgexpand image

Thanks in advance.

 

TOPICS
Actions and scripting
554
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
Community Expert ,
Jan 29, 2021 Jan 29, 2021

No.

 

Not All Layer contain pixels or are visible over a document canvas. Photoshop support many types of layers.  A Photoshop Script can Process all layers in a document  and do special processing of each layer type. 

 

It look like you know nothing about scripting and may not know Photoshop well.  If you want to script something  like you seem to want to you will need to learn a lot. A programming scripting language like JavaScript.  Learn Adobe's Photoshop Scripting DOM.  Read the Adobe Tools Guidelines for Adobe Scripting. Install the Scriptlistener Plug-in to be to use Action Manager script Code as well as Adobe DOM code. Adobe Scripting 

JavaScript-Tools-Guide-CC.pdf 

JJMack
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
Explorer ,
Jan 29, 2021 Jan 29, 2021

thanks JJMack. I do not know much about Photoshop Scripting nor am I planning to write this script but want to know if this is possible in scripting so I can pay someone to do it. I do know the Photoshop have many types of layers. I did not think of a script that could figure out what type of layer it is before acting. The script user would assume we are talking about a layer that contain solid pixels (100% opacity, except the edges maybe) and could even return an error if the script finds, say, a smart object layer or anything other than simple layer with an object there.

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 ,
Jan 29, 2021 Jan 29, 2021

You need to design something that would be possible. What you wrote is to general a solution would not be possible.    Adjustment layers can effect many layer. An added layer mask could  hide the layer content in the center of it bounds where your text label indicator would be located. You are not going to be able to determine  where a layer content over the canvas is and which one may be hidden by a layer mask.  Scripts are slow you can not examine a layer pixel by pixel it would take forever and a day. You could have a layer the would be  the black squares a a checker board. You may be able  process a Shape Layer's vector mask it would not be easy and still the shape layer could have a layer mask added that hides most of the shape layer. 

 

If  you have a collection of layered documents that have a common design that could annotated like you want.  You would need to design a logical process that  can be programmed that implement you annotation.

 

Programs do not assume they are logical process.  Also scripts have limitation The can only use some photoshop features and can not use Photoshop actual UI so thing you can do in Photoshop UI can not be done in a Photoshop script.  Scripts can only change a document usineg the Photoshop features it can use. 

JJMack
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
Explorer ,
Jan 29, 2021 Jan 29, 2021

Ok so if the script assume there is nothing fancy on the layers it could be annotated? Or do you mean the script do not have the means to know about smart object, masks, therefore can't be programmed? The script would be used in a collection of layered documents that have common design in a sense there would just ordinary layers with shapes (raster) on it, no mask, no  adjustment layers, no smart object or texts, no vectors, nothing. Just plain ordinary visible layers with names structured as screenshot shows 1_1, 1_2... etc

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 ,
Jan 29, 2021 Jan 29, 2021

Script can find out many things about Photoshop Objects like Layers,  layer kind, Id, Name, Bounds, Stack position, Mask, visible, opacity, fill etc. With the proper code scripts can do many things, However the can not do everything Script can not perform magic. There are limits as to what scripts can do.  You need to design a process that can with your logic do what you do with Photoshop UI to  manually annotate your documents. Scripts can add layers and edit them to make a text layer and  add text at some location x y location in the layer. If you do  not have a collection of document that have a design in common and know what you want done with them. I surly do not know what you want to do.

JJMack
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 ,
Jan 29, 2021 Jan 29, 2021

Instead of text layers you may use also Annotations (notes) tool?

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
Explorer ,
Jan 29, 2021 Jan 29, 2021
LATEST

thanks,  no just text 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