Photoshop CC 2014 and Python

Hello Folks,

So I am testing some of my python scripts with the newest version of Photoshop CC 2014 (version 15 I think?) and I’m having failures with comtypes calls that have worked for ages, specifically:

comtypes.client.CreateObject( “Photoshop.ActionDescriptor” )

Here’s the gross part: the scripts don’t even work with Photoshop CS5.1 if Photoshop CC 2014 is installed, which leads me to believe there are some shared libs that are updated that interfere with the comtypes commands.

Is anyone else experiencing this?

You may need to be more specific with the CreateObject. “Photoshop.Application”, for example, will grab the most recent version according to the registry. Try:


comtypes.client.CreateObject( "Photoshop.ActionDescriptor.55" )

Yes, one of the least fun things about PS+COM. A fellow named Evan recently posted a comment about that very thing on my PS+COM blog post. He specifically mentions ActionDescriptor.

Thx for the speedy replies. I’ll need to reinstall CC 2014 and test this method.

So…

appRef = comtypes.client.CreateObject(“Photoshop.Application”)
appRef55 = comtypes.client.CreateObject(“Photoshop.Application.55”)
appRef80 = comtypes.client.CreateObject(“Photoshop.Application.80”)

print appRef
print appRef55
print appRef80

<results>
12.1 (12.1x20110328 [20110328.r.145 2011/03/28:10:30:00 cutoff; r branch])
12.1 (12.1x20110328 [20110328.r.145 2011/03/28:10:30:00 cutoff; r branch])

appRef80 times out

I’m tryna work through the problem, stay tuned.

update:

If you run each build call in isolation, they work.

what is the relationship of “55” or “80” to Photoshop’s version?
I have version 12.0.0.

AFAIK:
80 is photoshop CC 2014.2.0
55 is photoshop CS5.1

Here’s how you can find out what int to use for your version:

start button > run > regedit.exe
HKEY_CURRENT_USER\Software\Adobe\Photoshop

Here’s what i get what I do this:

As you can see, I have two versions installed.

I hope that helps :slight_smile:

Ok, I get version 12, which what I get if query Photoshop.Application.Version

The version number (12 in your case) doesn’t seem to map directly to the int that the comtypes call expects. Follow my directions and you should have your answer.

in regedit, I get 12 when I navigate to the same location

That’s the number (12) you should try i think.

Here are some references:

# Photoshop CS5 -> 55
# Photoshop CC 2017 -> 110
# Photoshop CC 2017 -> 120

Hope that helps!