JSX -> EXE (second round)

Participant ,
Jun 05, 2021 Jun 05, 2021

Copy link to clipboard

Copied

I want to run my app.exe application from CEP panel.

I've only started learning CEP.

I've read this thread:

https://community.adobe.com/t5/premiere-pro/jsx-gt-exe-gt-jsx/m-p/11993263

 

and installed CEP_HTML_test extension. As far as I understand from the above thread this HTML test panel already has the functionality to run external .exe file. But where? All that I see is this:

q_ppro1.png

I even wrote a script:

var oShell = new ActiveXObject("Shell.Application");
var commandtoRun = "D:\\mypath\\app.exe"; 
oShell.ShellExecute(commandtoRun,"","","open","1");

trying to run the app.exe 

 

Needless to say I got a run script error: ActiveXObject does not have a constructor

So what is the correct way to do this?

 

Yaroslav.

 

 

TOPICS
SDK, User interface or workspaces

Views

328

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 2 Correct Answers

Explorer , Jun 05, 2021 Jun 05, 2021
I think it is under Native Functions -> Process APIs -> Create process Also CEP panels can work with Node.js modules. You can use exec child process.e.g.:const exec = require('child_process').exec; // async exec(PATHtoEXE, function(err, stdout, stderr) { // callback });

Likes

Translate

Translate
Adobe Employee , Jun 05, 2021 Jun 05, 2021
Under the Native Functions --> Process APIs. 

Likes

Translate

Translate
Explorer ,
Jun 05, 2021 Jun 05, 2021

Copy link to clipboard

Copied

I think it is under Native Functions -> Process APIs -> Create process

 

Also CEP panels can work with Node.js modules. You can use exec child process.

e.g.:

const exec = require('child_process').exec; // async
exec(PATHtoEXE, function(err, stdout, stderr) {
           // callback
});

 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jun 05, 2021 Jun 05, 2021

Copy link to clipboard

Copied

Thank you Ivan and Bruce.

I have one more question.

Here are the steps I followed so far:

1.

To allow nodejs I added nodejs.html  (copied from CEP_HTML_test_extension) to my client folder (where index.html and CSInterface.js reside).

2. My index.js and index.jsx are in the same folder with Nodejs.html .

In the index.js I put a simple code:

 

 

var csInterface = new CSInterface();
var openButton = document.querySelector("#open-button");
openButton.addEventListener("click", openDoc);
function openDoc() {
  csInterface.evalScript("openDocument()");
}

 

 

In my index.jsx I entered the following code:

function openDocument(){
const exec = require('child_process').exec; // async
exec("D:\\Yaroslav2021\\anytex\\anytex.exe", function(err, stdout, stderr) {});
}

However, when I start the panel and click the button  it gives an error:

"require is not a function"

 

How could I avoid this problem?

 

 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jun 05, 2021 Jun 05, 2021

Copy link to clipboard

Copied

LATEST

It seems that for the usage node.js one needs to install the node.js 

I think it is easier to use the already given functionality of  CEP_HTML_test_extension

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Jun 05, 2021 Jun 05, 2021

Copy link to clipboard

Copied

Under the Native Functions --> Process APIs. 

Screen Shot 2021-06-05 at 9.53.26 AM.png

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines