How to communicate between Electron App and Photoshop plugin?

I can confirm TextEncoder isn’t there yet, the UXP team knows about this.

2 Likes

Jarda, I came back to this post as I’ve been using WebView for my plugin and it works perfect for what I need, however, the UXP frame is very limited, I need the user to be able to “full screen” and with UXP is very laggy and the user cannot do a “Full screen” of the plugin, and with Electron is very smooth and can be full screened, I’m thinking to go back to the Electron app communicating with Photoshop method. What I only need is to send information from PS to my electron App and then from my electron APP to photoshop, basically I would use UXP to send a base64 to my electron APP and then manipulate that data there. I saw your Phantomatic plugin does this and somehow updates realtime?

You said you managed to make it work using websockets? So your Phantomatic plugin is listening every change in Photoshop and then send the image to the Electron app and update the HTML element with the imported image from PS? Is that how it works?

I think this would be my best solution, I really don’t want to get into C++ or other things to build my plugin as atm I don’t need it, what I’m looking for is just to communicate my Electron App with PS and send base64 information between them, so websockets is the way? Or there’s a special API that can do this?

Thanks in advance man!

Yes, you described it well. For huge data you can consider save it to harddrive without compression… that could be faster in some cases if ws would be slow.

1 Like

Thanks for the advice Jarda. I found a way to trigger my Electron app with UXP when the user opens the plugin, I just needed to make the Electron app to start at the system startup and let it run as a process in the background with a websocket server at certain port and then when the plugin is fired it connects to this server and sends a notification to open the Electron window. It is amazing how we can manipulate data to make our toys being alive it is just damn exciting!

1 Like