Run .exe File in PR via ExtendScript

New Here ,
Mar 21, 2017 Mar 21, 2017

Copy link to clipboard

Copied

Hi,

I'm trying to run a .exe File via ExtendScript. We're doing the same in AE which works fine using "system.callSystem(xyz.exe)" but "system" is unknown to Premiere.

Any ideas how to solve this?

Thanks,

Mathias

TOPICS
SDK

Views

2.1K

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 1 Correct answer

Participant , Mar 21, 2017 Mar 21, 2017
Exactly, node.js is not available in ExtendScript.You can see it as some kind of framework/library that gives you server-features that standard browsers do not have. You can access the file-system or (in this case) execute shell commands. See the docs for all features: Node.js v4.1.0 Manual & Documentation  Node.js is running inside Premiere and you use it in your Javascript code. So you don't have to install it or set a server up, it's all there waiting for you to be used.You can read more abou...

Likes

Translate

Translate
Participant ,
Mar 21, 2017 Mar 21, 2017

Copy link to clipboard

Copied

Node.js is your friend. You can execute commands using the node.js module 'child_process'. It works like this:

var process = require('child_process');

var exec = process.exec;

var cmd = "your windows prompt command";

exec(cmd, function(err, stdout, stderr) {

});

Since I´m a mac user, I have no idea which command executes an exe file from the command prompt but I'm sure you know it.

I hope this helps.

Thomas

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
New Here ,
Mar 21, 2017 Mar 21, 2017

Copy link to clipboard

Copied

Thomas, thanks a lot for your fast response!

I'm still trying to understand what node.js is about... it only works in HTML, right? Right now I'm using the ExtendScript Toolkit only.

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 ,
Mar 21, 2017 Mar 21, 2017

Copy link to clipboard

Copied

Exactly, node.js is not available in ExtendScript.

You can see it as some kind of framework/library that gives you server-features that standard browsers do not have. You can access the file-system or (in this case) execute shell commands. See the docs for all features: Node.js v4.1.0 Manual & Documentation 

Node.js is running inside Premiere and you use it in your Javascript code. So you don't have to install it or set a server up, it's all there waiting for you to be used.

You can read more about it here: CEP 6 HTML Extension Cookbook for CC 2015 · Adobe-CEP/CEP-Resources Wiki · GitHub

It is worth noting that you have to enable node.js in the CSXS/manifest.xml file of your panel. Like this:

<DispatchInfoList>

        <Extension Id="com.frameio.panel">

            <DispatchInfo >

                <Resources>

                    <MainPath>./index.html</MainPath>

                    <CEFCommandLine>

                        <Parameter>--enable-nodejs</Parameter>

...

Thomas

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 ,
Mar 21, 2017 Mar 21, 2017

Copy link to clipboard

Copied

Mathis, here's an old blog post about CEP panels, that shows how to fire a command line from within a panel; search it for 'mkdir'.

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
New Here ,
Mar 22, 2017 Mar 22, 2017

Copy link to clipboard

Copied

Thank you both!

It took some time to set up this HTML thing, but now its working!

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
Explorer ,
Apr 12, 2022 Apr 12, 2022

Copy link to clipboard

Copied

LATEST

Is there any way to call CEP script for extendscript to run external command?

From CEP panel i'm starting extendscript that creates sequense, and i need to run external ffmpeg command to make speedramp on some video files before inserting them to sequense (Time remapping is not available through extendscript)

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
New Here ,
Mar 22, 2017 Mar 22, 2017

Copy link to clipboard

Copied

Is there any possibility to make javascript wait until the cmd command is finished?

In my case the command is writing a txt file that will be processed later. At the moment javascript does not wait until it is complete which leads to some strange results...

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 ,
Mar 22, 2017 Mar 22, 2017

Copy link to clipboard

Copied

I think the "use callback functions" suggestion on this StackOverFlow page will do what you want, without introducing a JQuery dependency (as the "use JQuery promises" suggestion would)...

http://stackoverflow.com/questions/21518381/proper-way-to-wait-for-one-function-to-finish-before-con...

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