loonghao / photoshop-python-api

Python API for Photoshop.
https://loonghao.github.io/photoshop-python-api/
MIT License
643 stars 74 forks source link

`slelect` method is missing in Code Reference #332

Open Aunmag opened 10 months ago

Aunmag commented 10 months ago

Describe the bug Copy And Paste exmaple refers to selection.select method but it isn't listed in code reference docs.

To Reproduce Go to Selection docs and there's no slelect method

Expected behavior It should be there.

Additional context I'm starting to learn Photoshop API and was looking for method to select entire layer and copy it to another image. Seems like docs don't show full list of available instruments.

zhougeAI commented 9 months ago

Essentially, this library is a Python shell version of Photoshop VB script. On Windows, an alternative solution is to use the win32com library to directly operate PS through COM, Like this:

import win32com.client
psApp = win32com.client.Dispatch("Photoshop.Application")
psApp.Open(r"C:\xxx\xxxxx\x.psd")
doc = psApp.Application.ActiveDocument
doc.ArtLayers[0].Rotate(45)

But how we know the API reference and document of Photoshop VB script? Of course, Adobe provide the API reference in https://community.adobe.com/havfw69955/attachments/havfw69955/photoshop/556207/1/photoshop-vbs-ref-2020_unlocked.pdf So if you want to use Python to control Photoshop as you want, you can develop according to official Photoshop VB script reference. Many methods (like all methods of ArtLayers) are totally same as VB script.