Copy link to clipboard
Copied
Hi,
So I know that in After Effects you can use the following command through a batch file to execute extendscript code remotely.
afterfx.exe -r "alert('Hello World');"
The issue I can't seem to find a way to do the equivalent in Premiere.
According to this thread you can do it using the argument /C es.processFile 'path to file' however that does not appear to work.
According to the latest premiere docs you can execute an extendscript file or command this way, but once again it's never mentioned how and searching through the docs I can't find anything.
I've already tried using the Process Explorer on a curently opened version of Premiere and searching through the stings as per this thread answer, however I couldn't find anything that resembled arguments.
If the command ever did work, did they take it out? And if so why would they not mention that anywhere?
Any help would be much appreciated, thank you.
PeMatthew​ So from what I can tell, you can only execute a script from the CLI while launching Premiere, you can't run on an existing Instance.
1. Make sure you have a extendscriptprqe.txt file in the executable directory (doesn't matter what's inside)
2. To execute a file, use:
"C:\Program Files\Adobe\Adobe Premiere Pro CC 2019\Adobe Premiere Pro.exe" /C es.processFile "C:\path\to\test.jsx"
3. To execute a string, use:
..."C:\Program Files\Adobe\Adobe Premiere Pro CC 2019\Adobe Premiere Pro.exe" /C es.
Copy link to clipboard
Copied
Wow, I didn't know this was even possible. Yea none of those commands are working for me either, running
"C:\Program Files\Adobe\Adobe Premiere Pro CC 2019\Adobe Premiere Pro.exe" /C es.processFile "C:\Users\Justin\Desktop\extendscriptprqe.jsx"
just throws this error:
bbb_999​ Do you have any examples on how this works and or if it does work in the current release of PPRO?
Copy link to clipboard
Copied
Instead of passing the path to a .txt file, pass the path to the .jsx file you’re trying to execute.
Also, that extendscriptprqe.txt file needs to be present next to the PPro executable, to enable running scripts from the command line.
Copy link to clipboard
Copied
bbb_999 My mistake, realized that soon as I posted... Just updated with a .jsx
Okay, now I've got an empty extendscriptprqe.txt file and a test.jsx file in the executable directory, restarted Premiere, and still getting this error:
with command:
"C:\Program Files\Adobe\Adobe Premiere Pro CC 2019\Adobe Premiere Pro.exe" /C es.processFile "C:\Program Files\Adobe\Adobe Premiere Pro CC 2019\test.jsx"
Copy link to clipboard
Copied
Well, I can’t test this from my phone, but im told this works on Windows:
C:\Program Files\Adobe\Adobe Premiere Pro CC 2019\Adobe Premiere Pro.exe" /C es.processFile "C:\path\to\script.jsx"
Copy link to clipboard
Copied
bbb_999 Oh cool, it works when Premiere isn't already running! Assuming it can't execute on an already running instance of Premiere, does that right?
Copy link to clipboard
Copied
That sounds totally plausible.
Panels remain the recommended platform, from which to run ExtendScript in PPro.
Copy link to clipboard
Copied
PeMatthew​ So from what I can tell, you can only execute a script from the CLI while launching Premiere, you can't run on an existing Instance.
1. Make sure you have a extendscriptprqe.txt file in the executable directory (doesn't matter what's inside)
2. To execute a file, use:
"C:\Program Files\Adobe\Adobe Premiere Pro CC 2019\Adobe Premiere Pro.exe" /C es.processFile "C:\path\to\test.jsx"
3. To execute a string, use:
"C:\Program Files\Adobe\Adobe Premiere Pro CC 2019\Adobe Premiere Pro.exe" /C es.process "alert('hello world');"
As bbb_999 mentioned, CEP Panels really are better suited for running scripts in Premiere. If you want one without a UI, you can make an invisible panel that launches on application start, and then communicate with that externally if you need to through WebSockets.
Copy link to clipboard
Copied
Copy link to clipboard
Copied
On premiere 2021 is doesn't works, if premiere is not running it just doesn't do anything, if already started is says that file doesn't exists...
Copy link to clipboard
Copied
I've confirmed that invoking scripts from a command line does indeed work in PPro 15.x.
Please send me the command line(s) you're passing, and the script you'd like to invoke. bbb@adobe.com
Copy link to clipboard
Copied
Bruce Bullis could you help me with this also? I am trying to open PPro 2022 and run an extendscript from a batch script. I have followed the instructions from justintaylor's post as best I could and no joy.
Copy link to clipboard
Copied
Justin's instructions work fine here (once I change '2019' to '2022')...specifically, what failure do you see?
Copy link to clipboard
Copied
Thanks for getting back to me 🙂
The issue is that once Premiere opens then the extendscript doesn't run and the batch script hangs until I close Premiere manually. In Premiere's preferences I switched off the home screen so Premiere automatically opens the most recent project. I don't believe the issue is with my extendscript because when run from ExtendScript Toolkit it works as expected.
Here are the steps I took:
1. Added the extendscriptprqe.txt file to the Adobe Premiere Pro 2022 directory
2. Run this batch script:
"C:\Program Files\Adobe\Adobe Premiere Pro 2022\Adobe Premiere Pro.exe" /C es.processFile "C:\Users\nickw\Dropbox (Arcus Studios)\Arcus Studios shared workspace\ARC0268 - Ta-Dahs\8) Scenefiles\After Effects\Export Edit_PREM.jsx"
Copy link to clipboard
Copied
I've confirmed that, with the 'extendscriptprqe.txt' file present, the following works and executes on Win11:
"C:\Program Files\Adobe\Adobe Premiere Pro 2022\Adobe Premiere Pro.exe" /C es.processFile "C:\test.jsx"
Contents of test.jsx:
alert("Whee, I ran a script!");
[works regardless of Home screen display preferences]
Feel free to send me your .jsx file, directly.
Copy link to clipboard
Copied
Thanks for checking that for me. I've managed to get my script to run by moving it to "C:\" and renaming it "test.jsx". It seems like Premiere is picky about special characters in the file path and file name. I renamed the file and replaced the whitespace with an underscore, which has done the trick.
Copy link to clipboard
Copied
Glad you got it to work!
Small distinction, which doesn't make much of a difference: I'm pretty sure it's Windows being persnickety about non-escaped white space in path and file names. 🙂
Copy link to clipboard
Copied
Sounds about right 🙂
Thank you for your help!
Copy link to clipboard
Copied
Hi, May I ask, /C es.process What does it mean here.
Copy link to clipboard
Copied
That's a command line argument passed to PPro, when trying to execute a script from the command line.
Executing scripts from the command line is not at all recommended; Panels are the right place from which to execute scripts.