Javascript execute .Bat

Does Anyone know if it’s possible to get a photoshop plugin to execute a .bat file? Or is there a way to get UXP to fire an external script like python?

1 Like

Would love to learn more about your use case here.

There is no mechanism that enables this currently without involving a helper app & some communication channels between the helper & the plugin.

Basically I have photoshop export a texture for a 3d object, then it gets rendered in a 3D app, afterwards the rendered images are put inside the plugin data folder so that PS can access them dynamically for use within the plugin.

At the moment, the user can create the texture, then has to manually click the correct python script, then can proceed with using the plugin.

There is a long winded way to get it working with JSX but that more or less means doing the above anyway.

I’td be quite useful if PS could fire external scripts if only to execute them but i understand it’s also a potential security concern.

Hi,

I tested CURL.EXE from javascript.

var result = window.cep.process.createProcess(getCURLPath(), RestAPIUrl, '-k', '-o', dest, '-X', 'POST', '-H', 'Content-Type: application/json', '-d', dataJSON);

function getCURLPath() {
	var OS = store.getters.getOS;
	if (OS === "WIN") {
		return 'C:\\C4Utils\\curl.exe';
	} else {
		return  '';
	}
}

I hope this helps you.

Best Regards
Karoly

Are you able to explain a bit more about the dependencies for this to run?

Thanks

Sorry, it works only from CEP.