Can I call childProcess.exec()?

Hi all,

I am starting with UXP Plugins in Photoshop, and I need to import node modules.

But for example, when I try to import child_process for call external app, it says:

Module not found: “child_process”. Parent module folder was: “./”.

I am not sure if is it possible.

My code is:

const { exec } = require(“child_process”);

Is it already available?

Thanks!

UXP does not provide a full Node environment. Calling out to a child process is not currently possible. We are adding support for launching external apps, but this won’t be quite the same as a child process (no watching stdout, for example). Any interprocess comms would have to be negotiated between plugin and launched app.

We were facing the same issue with our plugins which relied heavily on a full Node environment. Our solution was to build a Node application that runs aside from the plugin.

To communicate with the Node application we use WebSockets but you could also use XMLHttpRequests. It’s a bit of a drag but we managed to rebuild all features that we used to have in the old environment.

Thanks for the reply @kerrishotts , but then I have more questions:

When will be available this? Is there more information about how it will work?

And thanks a lot for the solution @jjdenhertog, may be is a stupid question, but how do you launch this “backend” Node application that runs aside?

Currently it’s not possible to launch an application from UXP. So we add instructions to run an application besides the extension. We make a request to verify if the application is running, and display a message if it’s not the case.

As soon as there is an option to launch an external app we will probably simply show a button to launch the app.

1 Like

Hi @kerrishotts

I came across this post when looking for the same topic.
Any news regarding the ability to launch external apps?

Thanks

Henrique \\ TMMW
Text Replacer for Premiere Pro | Clips Exporter | Thumbs Up | Selector for Premiere Pro

hi @jjdenhertog

how exactly do you “add instructions to run an application besides the extension”? Can you share code snippets of how to do this please.

For example where do you add these instructions?\

Thanks

When will the support for launching external apps be ready?

See Big Updates Coming to UXP. Webview, UXP Scripting, C++ Hybrid… | by Padma Krishnamoorthy | Adobe Tech Blog | Medium

As of Ps 23.3.x, you can use Manifest v5 (required) and require("shell").openExternal and require("shell").openPath. Users will be prompted for consent (they can remember their choice to avoid being prompted again).

1 Like

A ready-to-use solution with Hybrid Plugins has been provided here:

1 Like

This is something I will definitely look into.

1 Like