I need to solve a very basic problem - I need to know which document is currently selected in Photoshop at any given time.
There are a number of ways to do this, namely:
1) Subscribe for Photoshop events using CSXSInterface(i.e. using CSXSInterface::addEventListener) and then, in the event handler, access the active document property using CSAW object model (i.e. com.adobe.csawlib.photoshop.Photoshop.app.activeDocument).
2) Subscribe for PS events using ExtendScript interface(i.e. evalScript("PhotoshopRegisterEvent")) and then, in the event handler, access the Photoshop object model using the ExtendScript interface (by calling app.activeDocument.name from ExtendScript).
3) Subscribe for Photoshop events using CSXSInterface(i.e. using CSXSInterface::addEventListener) and then, in the event handler, access the Photoshop API using ActionDescriptors API (executeAction and executeActionGet APIs).
Unfortunately there is a major bug in Photoshop CS5 on Mac that makes Photoshop document model inaccessible from all OS-initiated event handlers. This bug seems to affect all the methods listed above. As a result, none of them works with Photoshop CS5 on Mac.
If I subscribe for CSXSInterface, I am able to access the activeDocument property of the com.adobe.photoshop.Application object, but the event comes in before the active document has changed, not after, so I cannot find out which document was selected.
I tried adding a timer in ActionScript and checking the active document a second after the event, but from the activeDocument property is not accessible from the timer handler.
If I try to use extendScript to access Photoshop DOM inside an event handler, I get the following error: “Error: General Photoshop error occurred. This functionality may not be available in this version of Photoshop.”.
The same error occurs when I try to use executeActionGet API. I suspect that executeActionGet calls ExtendScript code under the hood, so I get the same result.
So, is there any way to use Photoshop API from an event listener on Mac CS5? Can some Adobe employee please comment on this situation?
Thank you in advance,