clsid
Resolve Photoshop automation class IDs when no versioned ProgID is published.
A regular Photoshop installation publishes a versioned ProgID for every automation class (Photoshop.ActionDescriptor.190 and friends), which is what this library resolves classes through. Some installations -- notably portable or relocated copies -- register the very same classes under a bare CLSID with no ProgID at all. Those classes are perfectly creatable, but every Photoshop.<Class> lookup fails.
This module resolves a coclass name to its CLSID for those installations:
- Photoshop's own type library is read and indexed. The type library ships with Photoshop and declares every automation coclass by name, so this route is exact and instantiating anything is not required.
- If the type library is unavailable, the CLSIDs registered as Photoshop local servers are instantiated and asked for their coclass name through
IDispatch::GetTypeInfo. This only depends on Photoshop itself and is used as a last resort, because it instantiates one automation object per candidate CLSID and costs roughly a second per candidate.
Both routes are read-only with respect to Photoshop's registration, and results are cached for the lifetime of the process.
reset_cache()
Forget every cached lookup. Only useful for tests and long lived processes.
Source code in photoshop/api/_clsid.py
88 89 90 91 92 93 94 95 | |
resolution_failure_reason(object_name)
Return why a lookup of object_name returned None, for error reporting.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
object_name | str | Photoshop coclass name that could not be resolved. | required |
Returns:
| Type | Description |
|---|---|
str | A human readable reason, or a fallback when no lookup recorded one. |
Source code in photoshop/api/_clsid.py
76 77 78 79 80 81 82 83 84 85 | |
resolve_photoshop_class_id(object_name)
Return the CLSID of a Photoshop coclass, or None when it cannot be resolved.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
object_name | str | Photoshop coclass name, e.g. | required |
Returns:
| Type | Description |
|---|---|
Optional[str] | The CLSID formatted as |
Source code in photoshop/api/_clsid.py
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 | |
Created: 2026-10-01