Highlighted

How to require javascript library in plugin?

New Here ,
Jul 08, 2020

Copy link to clipboard

Copied

A little bit of background: I have a plugin where I need to gather the system's hardware specs and ideally I would use something like node-wmi (https://www.npmjs.com/package/node-wmi) to directly access WMI to gather things like the CPU, GPU, RAM, etc. However, I can't figure out how to get external libraries included in a Premiere Pro Plugin. I know you can include Node.js and some others in the manifest file inside "<CEFCommandLine>", but I don't believe that works for custom libraries like this. It also doesn't look like CEP doesn't have a require function - it is mentioned in the CEP 9 cookbook, but anytime I try to use it it breaks the script.

 

Right now, I am using "window.cep.process" to run "wmic get" commands and it works most of the time, but seemlingly randomly it doesn't return properly - hence why I would prefer to use a library like node-wmi.

 

Any recommendations?

TOPICS
SDK

Views

42

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

How to require javascript library in plugin?

New Here ,
Jul 08, 2020

Copy link to clipboard

Copied

A little bit of background: I have a plugin where I need to gather the system's hardware specs and ideally I would use something like node-wmi (https://www.npmjs.com/package/node-wmi) to directly access WMI to gather things like the CPU, GPU, RAM, etc. However, I can't figure out how to get external libraries included in a Premiere Pro Plugin. I know you can include Node.js and some others in the manifest file inside "<CEFCommandLine>", but I don't believe that works for custom libraries like this. It also doesn't look like CEP doesn't have a require function - it is mentioned in the CEP 9 cookbook, but anytime I try to use it it breaks the script.

 

Right now, I am using "window.cep.process" to run "wmic get" commands and it works most of the time, but seemlingly randomly it doesn't return properly - hence why I would prefer to use a library like node-wmi.

 

Any recommendations?

TOPICS
SDK

Views

43

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
Jul 08, 2020 0
Adobe Employee ,
Jul 09, 2020

Copy link to clipboard

Copied

Not sure (I support PPro's ExtendScript API), but...is this of any use?

https://medium.com/adobetech/how-to-build-a-node-js-server-in-a-panel-ba1d63ea67e2


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
Reply
Loading...
Jul 09, 2020 0