How to locate current_document property using Appscript in Python for Photoshop 2022
I (foolishly) upgraded to Mac OSX Monterey, which in turn forced me to upgrade my Photoshop version to Photoshop 2022.
With Photoshop CC 2018 I used the following python code to get a specific layer by name:
from appscript import * self.psApp = app('/Applications/Adobe Photoshop CC 2018/Adobe Photoshop CC 2018.app') for layer_set in self.psApp.current_document.layer_sets(): for group in layer_set.layers.get(): if group.name() == "image_1": return group
Which worked great! Docs can be found here by the way.
But, when using the same code and replacing Adobe Photoshop CC 2018 with Adobe Photoshop 2022 I get an 'Unknown Property' error:
AttributeError: Unknown property, element or command: 'current_document'
And I can't get anything else to work anymore, the 'current_document' property seems to be gone or maybe renamed?
Any help would be greatly appreciated. The documentation for this is pretty much non-existent unfortunately.
Thanks in advance!