Copy link to clipboard
Copied
Looking for a way to run JavaScript aka ExtendScript in Premiere Pro CC
Here's what I've got for other Adobe Apps, using AppleScript:
tell application "Adobe After Effects CC 2015"
activate
set SomeExtendScript to "ThisVariable='Runs This Js Code';"
DoScript SomeExtendScript
end tell
tell application "Adobe Photoshop CC 2015.5"
activate
set SomeExtendScript to "ThisVariable='Runs This Js Code';"
do javascript SomeExtendScript
end tell
tell application "Adobe Illustrator"
activate
set SomeExtendScript to "ThisVariable='Runs This Js Code';"
do javascript SomeExtendScript
end tell
But so far nothing for Premiere.
tell application "Adobe Premiere Pro CC 2015"
activate
set SomeExtendScript to "ThisVariable='Runs This Js Code';"
-- Does not work: DoScript SomeExtendScript
-- Does not work: do javascript SomeExtendScript
-- Does not work: do script SomeExtendScript
end tell
ExtendScript = Adobe-flavored JavaScript. Very similar.
For other Adobe products AppleScript has been the key to doing that.
Yes, but there's no need to limit your solution to one platform!
I'd be curious to see what you're doing, in AE.
Instead of triggering ExtendScript from some external database-driven system, you can put buttons in an HTML5 (JavaScript-based) panel for the user's convenience.
Here's the PProPanel sample; the other samples in the repository have prettier HTML and use modern
...Copy link to clipboard
Copied
JavaScript is not ExtendScript; PPro handles them with two different interpreters.
What is it you're trying to do, in Premiere Pro?
Copy link to clipboard
Copied
Let me know if I’ve got terms jumbled:
I understand ExtendScript to be an Adobe application, a JavaScript editor which users develop Adobe-enhanced JavaScript code that can be used to automate a variety of Adobe products.
ExtendScript may also be the name given to to the Adobe-version JavaScript described above. (T/F?)
Your note above — that JavaScript and ExtendScript involve two different interpreters — is news to me. Interested to know more on that.
Regarding what I’m trying to do:
I develop routines, frequently testing in the ExtendScript App, and then, once developed, run that code from an external Database-driven system that runs any number of custom-developed routines. This allows external-to-Adobe databases to, for instance, generate customized files in Illustrator, Photoshop, and After Effects.
In this case the goal is to use a similar approach to push metadata from an external database to Premiere Pro project items (source clips). So far it’s working great in ExtendScript application, but to take this to the next level I need to be able to send JavaScript commands directly to Premiere without using the ExtendScript App. For other Adobe products AppleScript has been the key to doing that.
Hope all that makes sense.
Copy link to clipboard
Copied
ExtendScript = Adobe-flavored JavaScript. Very similar.
For other Adobe products AppleScript has been the key to doing that.
Yes, but there's no need to limit your solution to one platform!
I'd be curious to see what you're doing, in AE.
Instead of triggering ExtendScript from some external database-driven system, you can put buttons in an HTML5 (JavaScript-based) panel for the user's convenience.
Here's the PProPanel sample; the other samples in the repository have prettier HTML and use modern web frameworks; PProPanel is pretty exhaustive in PPro ExtendScript API usage:
Samples/PProPanel at master · Adobe-CEP/Samples · GitHub
Pushing metadata to projectItems = PProPanel shows how to get and set static (Metadata panel) and temporal (marker) metadata.
Here's "How to set up a panel dev environment":
Samples/ReadMe.md at master · Adobe-CEP/Samples · GitHub
Work through the readme, play with the sample, and feel free to ask me anything!
Copy link to clipboard
Copied
Bruce, very cool!
To answer your question re After Effects, basically it's the same as we're doing in Photoshop and Illustrator, only a little more sophisticated to accommodate AE. The DataBase sends customized Adobe JS via AppleScript to an AEP, filling in text layers, and rendering out MOVs, maintaining a rigorous naming convention. In other words, we're passing Adobe JS with entries along the lines of Comp="CompName"; TextLayer1="FirstName LastName"; OutputModule="QuickTimePlusAlpha"; DestFileName="DestPath/FileName.Ext". Ultimately it's similar to using Adobe Live Text Templates, but we're editing in Avid. Fully automated and works great and is extremely flexible.
If I'm understanding what you're saying (and a peek at the samples you linked to suggest so), it's possible to use HTML5/JS instead of AppleScript to pass commands to Premiere. I wasn't immediately able to understand how the communication takes place. Simply running the index.html under your PProPanel is, as expected, insufficient.
Is setting up a custom panel in Premiere essential to the process? From the sample it looks like the commands pass directly from the HTML page into Premiere. Correct? What's the __adobe_cep__ object? It's coming up undefined on my end?
Copy link to clipboard
Copied
A panel is mostly a web page (HTML/JavaScript), which can call into our apps (using ExtendScript).
I wasn't immediately able to understand how the communication takes place. Simply running the index.html under your PProPanel is, as expected, insufficient.
Is setting up a custom panel in Premiere essential to the process? From the sample it looks like the commands pass directly from the HTML page into Premiere. Correct? What's the __adobe_cep__ object? It's coming up undefined on my end?
Yes, having the panel load in PPro is essential.
The commands pass from JavaScript, to ExtendScript, using the evalScript() call provided by Adobe's CEP (panel hosting) infrastructure.
[There's currently a typo in the PProPanel sample that keeps the ExtendScript from firing; I'll fix that today, time permitting.]
Copy link to clipboard
Copied
Thanks for all that.
Some additional questions I'll be chasing down as we get into this -- maybe you can answer in advance:
- Since much of what we're doing involves access to ever-evolving datasets, what are avenues for accessing data in this environment?
- Is the SDK environment sandboxed to keep it from communicating with the web or is it possible to retrieve online datasets?
- From what I've read so far, any changes to the HTML require a quit/relaunch to go into effect. Correct? Is the same true if you change an underlying .JSX file? We're constantly tweaking code and changing data, so if there are ways to minimize the number of quit & relaunches, it's always preferred.
- I saw in the manifest of your sample the parameter enable-nodejs. Is that available natively within the SDK architecture? Been meaning to get into Node.js. Perhaps this is the intro I've been waiting for. Is PHP an option?
Copy link to clipboard
Copied
Also -- this whole PProPanel approach I realize is a (welcome) tangent from the original question about AppleScript. HTML/JS looks like a great leap forward, but as to the original question: is it possible to send JSX (Adobe JS) commands to Premiere via AppleScript?
Copy link to clipboard
Copied
Is it possible to send JSX (Adobe JS) commands to Premiere via AppleScript?
It is in some cases possible, though not recommended, to blindly send commands to PPro using AppleScript, including invocation of a specific ExtendScript file.
Blindly = no interactive messaging with invoking process.
Copy link to clipboard
Copied
Bruce Bullis wrote:
It is in some cases possible, though not recommended, to blindly send commands to PPro using AppleScript, including invocation of a specific ExtendScript file.
Blindly = no interactive messaging with invoking process.
So what I was looking for was the AppleScript equivalent of...
do javascript (Illustrator/Photoshop)
DoScript (After Effects)
...for Premiere.
Mind you, your HTML/JS looks far and away preferable. I won't miss AppleScript.
Copy link to clipboard
Copied
- Since much of what we're doing involves access to ever-evolving datasets, what are avenues for accessing data in this environment?
Whatever avenues are available to a web page, are available to a PPro panel. The PProPanel sample shows how to get and set static and temporal metadata for any project item.
- Is the SDK environment sandboxed to keep it from communicating with the web or is it possible to retrieve online datasets?
It's just a web page; do what you like.
- From what I've read so far, any changes to the HTML require a quit/relaunch to go into effect. Correct?
Incorrect. What have you been reading? Closing and re-opening the panel is sufficient to reload both its JavaScript and ExtendScript.
- I saw in the manifest of your sample the parameter enable-nodejs. Is that available natively within the SDK architecture? Been meaning to get into Node.js. Perhaps this is the intro I've been waiting for. Is PHP an option?
Node.js is definitely supported; I believe PHP will work as well. CEP HTML Test Extension shows Node.js usage:
Copy link to clipboard
Copied
Now I´m curious how PHP is supported. This is not working:
<?php echo '<p>Hallo Welt</p>'; ?>
Copy link to clipboard
Copied
The RSSReader sample contains lots of references to PHP. I've never used it.
Copy link to clipboard
Copied
Bruce Bullis schrieb:
The RSSReader sample contains lots of references to PHP. I've never used it.
Just went through the code. I wasn´t able to find any php code (even by searching the whole Github repo). It uses a Node.js module called mustache to do the parsing. No PHP or am I overseeing something?
Copy link to clipboard
Copied
238 occurrences of 'PHP' across 33 files, in our /Samples repository; as before, I've never used it.
Copy link to clipboard
Copied
Bruce Bullis schrieb:
238 occurrences of 'PHP' across 33 files, in our /Samples repository; as before, I've never used it.
Are we talking about this repo? -> https://github.com/Adobe-CEP/Samples
My search for "PHP" gives me 12 results. These are mainly links to comments.
Copy link to clipboard
Copied
Bruce Bullis schrieb:
238 occurrences of 'PHP' across 33 files, in our /Samples repository; as before, I've never used it.
Thomas_Szabo wrote:
Are we talking about this repo? -> https://github.com/Adobe-CEP/Samples
My search for "PHP" gives me 12 results. These are mainly links to comments.
So far the only references to PHP I found are within JQuery libraries, so no leads on whether it's possible to host a PHP within the scope of your extension. Perhaps worth a new thread.
HOWEVER...
In Mac OS, at least, you are able to make ajax calls from the Finder to the web, even localhost, without cross-domain errors. In other words, ajax to PHP in any hosted environment get back anything that PHP, in turn, can connect to. I just tested and was able to retrieve text, HTML code, and a large JSON dataset from a hosted database we're using. Whatever you want.
Is the same/similar true for other OS platforms?
Copy link to clipboard
Copied
Bruce Bullis, thanks for all your help. Managed to get a custom panel fully up and running. First tests involved reading and changing metadata (column data) for project items, and all went well. Amazing. Thanks again.
Copy link to clipboard
Copied
No problem!
ALL: I've updated PProPanel on GitHub, to silence the outburst 'undefined is not an object' errors at panel open. <sigh>
Copy link to clipboard
Copied
Thomas_Szabo wrote:
Now I´m curious how PHP is supported. This is not working:
<?php echo '<p>Hallo Welt</p>'; ?>
Node.JS seems to require the parameter enable-nodejs in the manifest. If PHP is, in fact, available, it may require something similar. (?)
Copy link to clipboard
Copied
So I've dropped the PProPanel sample into folder (Mac OS): /Library/Application Support/Adobe/CEP/extensions/PanelDir/PProPanel
and run the following in Terminal: defaults write ~/Library/Preferences/com.adobe.CSXS.6.plist PlayerDebugMode 1
Then launched Premiere.
Assuming I got that correct, next step?
Copy link to clipboard
Copied
Premiopolis schrieb:
So I've dropped the PProPanel sample into folder (Mac OS): /Library/Application Support/Adobe/CEP/extensions/PanelDir/PProPanel
and run the following in Terminal: defaults write ~/Library/Preferences/com.adobe.CSXS.6.plist PlayerDebugMode 1
Then launched Premiere.
Assuming I got that correct, next step?
Premiere menu Window > Extensions > PProPanel
Copy link to clipboard
Copied
Thomas_Szabo wrote:
Premiere menu Window > Extensions > PProPanel
Well, something's amiss. "Extensions" menu is still greyed out.
Copy link to clipboard
Copied
I notice there's a com.adobe.CSXS.7.plist right next to the com.adobe.CSXS.6.plist
Any reason to think latest version of Premiere CC is using the former?
Copy link to clipboard
Copied
PPro uses the CSXS.6 one.