This folder holds generated Python files that describe Photoshop’s COM scripting library (classes, methods, and constants such as psTextLayer).
They were produced with makepy from pywin32 against Photoshop’s type library (ScriptingSupport.8li). Example header:
# Created by makepy.py version 0.5.01
# From type library 'ScriptingSupport.8li'
'Adobe Photoshop 2021 Object Library'
| File | Photoshop version (approx.) |
|---|---|
photoshop_CC_2018.py |
CC 2018 |
photoshop_CC_2019.py |
CC 2019 |
photoshop_2020.py |
2020 |
photoshop_2021.py |
2021 |
These dumps are large and mostly for browsing names and enum numbers. Day-to-day scripts usually only need a few constants—prefer photoshop_scripting.constants or copy values from the class constants: section of a dump.
Windows only. makepy and Photoshop COM type libraries are a Windows workflow.
-
Windows
-
Adobe Photoshop installed (the version you want a reference for)
-
Python 3 with pywin32:
pip install pywin32
-
Optional: a place to save the output (this
api_reference/folder)
makepy reads the same type library COM uses. The file is usually:
ScriptingSupport.8li
Search under your Photoshop install, for example:
C:\Program Files\Adobe\Adobe Photoshop 2024\
C:\Program Files\Adobe\Adobe Photoshop 2025\
PowerShell:
Get-ChildItem "C:\Program Files\Adobe" -Filter "ScriptingSupport.8li" -Recurse -ErrorAction SilentlyContinue |
Select-Object -ExpandProperty FullNameIf that file is missing, repair/reinstall Photoshop, or pick the type library from the makepy GUI list (step below) after Photoshop has been launched at least once so it registers with COM.
-
Open a Command Prompt or PowerShell.
-
Start the COM browser / makepy UI:
python -m win32com.client.makepy
If that fails, try:
python -c "from win32com.client import makepy; makepy.main()" -
In the list of type libraries, find an entry like:
- Adobe Photoshop XX Object Library, or
- a name that mentions Photoshop / ScriptingSupport
-
Select it and confirm.
-
makepy generates a module under your pywin32
gen_pycache (not always into this repo). Typical location:%LOCALAPPDATA%\Temp\gen_py\or next to your Python install under
Lib\site-packages\win32com\gen_py\. -
Copy the generated
.pyinto this folder and rename it clearly, e.g.:api_reference/photoshop_2024.py
Useful when you know the exact type library path and want a predictable output file.
python -c "import win32com.client.makepy as m, inspect; print(inspect.getfile(m))"Example path:
...\site-packages\win32com\client\makepy.py
$typelib = "C:\Program Files\Adobe\Adobe Photoshop 2024\ScriptingSupport.8li"
$out = "C:\path\to\photoshop-scripting-python\api_reference\photoshop_2024.py"
python -m win32com.client.makepy -o $out $typelibIf -o is not accepted on your pywin32 version, run:
python -m win32com.client.makepy $typelib…then copy the new module from gen_py into api_reference/ as above.
Open the top of the generated file. You should see:
Created by makepy.pyFrom type library 'ScriptingSupport.8li'(or similar)- A title like
Adobe Photoshop 20XX Object Library - A large
class constants:block withps…names
At runtime, early-binding wrappers can be generated when you first use Photoshop:
from win32com.client import gencache
# May create gen_py modules the first time it runs
app = gencache.EnsureDispatch("Photoshop.Application")
print(app.Name, app.Version)That still writes into gen_py, not automatically into this repo. Copy into api_reference/ only if you want a checked-in snapshot for a specific Photoshop version.
# After placing the file on PYTHONPATH or importing from this folder:
from api_reference import photoshop_2021 as ps # if packaged
# or open photoshop_2021.py and search for:
# class constants:
# psTextLayer = 2Many samples in this project still document enums inline:
psTextLayer = 2 # from enum PsLayerKindThose numbers come from the same type library makepy dumps.
from photoshop_scripting.constants import LayerKind, Units, DialogModesOnly dig through full makepy dumps when you need an obscure constant or class name.
- Name files by Photoshop year:
photoshop_2024.py,photoshop_2025.py. - Regenerate when you upgrade major Photoshop versions if you rely on new APIs.
- Do not hand-edit generated files; regenerate and replace.
- Committing multi‑MB dumps is optional—document the makepy steps so others can build their own.
| Problem | What to try |
|---|---|
| No Photoshop entry in makepy list | Launch Photoshop once, then retry; confirm ScriptingSupport.8li exists |
makepy module not found |
pip install pywin32; use the same Python you install packages into |
Permission error reading .8li |
Run the shell as a normal user who can read Program Files\Adobe\... |
| Generated file is huge | Expected—type libraries expand to lots of Python stubs |
| Constants differ from an older dump | Normal across Photoshop versions; regenerate for your install |
- Windows backends (
win32comvscomtypes) - Main README
- C# interop DLLs from the same type library (
tlbimpinstead of makepy)
- Install Photoshop +
pip install pywin32on Windows. - Find
ScriptingSupport.8lior the “Adobe Photoshop Object Library” in makepy. - Run
python -m win32com.client.makepy(GUI or CLI). - Copy the generated module into
api_reference/photoshop_YEAR.py. - Use
class constantsfor enum values; keep day-to-day code on small helpers and samples.