Skip to main content
Participant
October 12, 2024
Question

Photoshop scripting - using enumerates.

  • October 12, 2024
  • 1 reply
  • 206 views

I'm starting to learn Photoshop python scripting and can't figure out the following:

 

when I need to use some of the Photoshop Classes, I use for example:

 

solidColor = win32com.client.Dispatch("Photoshop.SolidColor")   # import SolidColor class

 

but how can I import photoshop Enumerations, such as FontSize, BlendMode etc.?

 

I always end up with error: ".... not defiend" when trying to use Enumerations like: BlendMode.OVERLAY.

 

Could somebody please show any example of Photoshop Enumerations importing?

 

 

 

 

1 reply

OussK
Community Expert
Community Expert
January 23, 2025

When working with Photoshop scripting in Python using win32com.client, enumerations like BlendMode or FontSizeare not directly available in the same way as classes like SolidColor. These enumerations are part of Photoshop's scripting environment and are accessed differently.

In Python, you typically need to reference the enumeration values explicitly as their integer constants or use the win32com.client.constants object to access them dynamically.