Copy link to clipboard
Copied
Hi,
I'm referring to these ones:
Has someone been able to find a way to use them?
I've naively tried:
var csInterface = new CSInterface();
var event = new CSEvent();
event.type = "com.adobe.PhotoshopWorkspaceSet";
event.scope = "APPLICATION";
event.appId = csInterface.getApplicationID(); // "PHXS"
event.extensionId = csInterface.getExtensionID()
csInterface.dispatchEvent(event);
var PhotoshopCallback = function(evt) {
console.log("Fired!", evt);
}
csInterface.addEventListener("com.adobe.PhotoshopWorkspaceSet", PhotoshopCallback);
but I'm not sure whether I'm supposed to only dispatch the Event in order to make something happen (like the com.adobe.PhotoshopLoseFocus, returning focus from the panel back to PS), or the addEventListener is needed too.
Hints? 😉
Thanks,
Davide Barranca
---
Copy link to clipboard
Copied
Hi Davide,
It's been years and probably you've already figured it out, but just in case someone stumbles upon this thread
You were doing everything right, but you were firing the event BEFORE adding an event listener for it, so it had nothing to react to. You should have put csInterface.addEventListener call before csInterface.dispatchEvent.
Hope this helps,
Yuriy
Find more inspiration, events, and resources on the new Adobe Community
Explore Now