Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to visit all the text layers? #358

Open
zjj1997zju opened this issue Sep 7, 2024 · 3 comments
Open

How to visit all the text layers? #358

zjj1997zju opened this issue Sep 7, 2024 · 3 comments

Comments

@zjj1997zju
Copy link

I want to iterate through all text layers in a PSD file and retrieve the position and bounding box of each text layer.
My PSD file has a complex layer structure, and after reading some examples, I'm unsure how to recursively access all layers.

Can anyone help?

@lord-dubious
Copy link

if u find out let me know

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


if u find out let me know

@loonghao
Copy link
Owner

loonghao commented Sep 15, 2024

You can try below code.

import photoshop.api as ps

app = ps.Application()
for layer in app.activeDocument.layers:
    print(layer.typename)
    print(layer.bounds)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants