loonghao / photoshop-python-api

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

无法在mac 电脑上使用 建议兼容一下 #331

Open kkgg0521 opened 6 months ago

kkgg0521 commented 6 months ago

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

Additional context Add any other context about the problem here.

Issues-translate-bot commented 6 months ago

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


Title: cannot be used on mac computers. It is recommended to make it compatible.

zhougeAI commented 4 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 on MacOS, you can find some COM tools like win32com, then develop according to official Photoshop VB script reference. Many methods (like all methods of ArtLayers) are totally same as VB script.