Skip to content

TypeError: 'Layers' object is not subscriptable #18

@communitydev2

Description

@communitydev2

I cannot select a layer, this is my code

` import win32com.client as win32
import os
from comtypes.client import GetActiveObject, CreateObject

try:
adobe_app = win32.GetActiveObject("Photoshop.Application")
except:
adobe_app = win32.gencache.EnsureDispatch('Photoshop.Application')
try:
# cd = adobe_app.Open(filepath)
cd = adobe_app.ActiveDocument
except:
cd = adobe_app.ActiveDocument
# cd = adobe_app.ActiveDocument
currentTextLayer = cd.Layers[0]
print(currentTextLayer)

`

Any suggestions?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions