Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Premiere Pro Script execution without ExtendScript Toolkit confirmation

New Here ,
Feb 06, 2015 Feb 06, 2015

Hi everyone,

I'm creating a video browser OSX app, that will import files to opened project, open and play it in the source viewer in Premiere Pro.

The app creates a JSX file with:

"#target premierepro";

app.enableQE();

var result=qe.project.importFiles(argv);

var num=qe.project.numItems;

var proje=qe.project.getItemAt(num-1);

proje.openInSource();

qe.source.player.play();

It works correctly in ESTK, but if I open it inside my app, calling:

NSWorkspace *workspace = [NSWorkspace sharedWorkspace];

[workspace openFile:jsxFilePath];

//This exactly the same than opening it in Finder via double-clicking it

It shows me this confirmation dialog (sorry for the Spanish localization)

Captura de pantalla 2015-02-06 a la(s) 12.22.45.png

If I press 'Si(Yes)', the script is executed correctly inside Adode Premiere, if I press 'No', then ESTK opens in Debug mode. This is the same behavior if I open the jsx file in the Finder.

Then, how can I avoid this dialog every time the app runs a script?

Thanks a lot,

Regards,

TOPICS
SDK
5.5K
Translate
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

Adobe Employee , Feb 11, 2015 Feb 11, 2015

         Why I say partially? Because the alert appears, but before any PremierePro window is launching or any project (previous) is loaded, what pointed me that no useful script could be  used in this scenario.

That's correct behavior; many scripts open a project. You need a project open before you can do many things.

If you'd like to talk through how best to support your workflow, write me directly at b b b at adobe dot com.

Translate
Adobe Employee ,
Feb 06, 2015 Feb 06, 2015

Here's how to send an ExtendScript to PPro, from terminal:


/Applications/Adobe\ Premiere\ Pro\ CC\ 2014/Adobe\ Premiere\ Pro\ CC\ 2014.app/Contents/MacOS/Adobe\ Premiere\ Pro\ CC\ 2014 /C es.processFile /Users/username/Desktop/example.jsx

...and from a Command Prompt:

"C:\Program Files\Adobe\Adobe Premiere Pro CC 2014\Adobe Premiere Pro.exe" /C es.processFile "C:\example.jsx"

Translate
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 ,
Feb 06, 2015 Feb 06, 2015

Thanks a lot!

I tried to run it the same way but with the /r switch, thanks to point me to the /C es.processFile switch. There is no way to find it in any documentation (at least for me...)

What is supposed to do the /C switch? And what is the es.processFile argument? Is there any other es.xxxx command that could be of interest?

Regards

Translate
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 ,
Feb 06, 2015 Feb 06, 2015

/C = nothing useful.

The only other useful option here is that, instead of a file path to a .jsx, you can pass your script as a string;

"C:\Program Files\Adobe\Adobe Premiere Pro CC 2014\Adobe Premiere Pro.exe" /C es.processFile "alert('whee!');"

Translate
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 ,
Feb 09, 2015 Feb 09, 2015

Hi,

Sorry, maybe I'm doing something wrong, or there is a typo error but every time I launch the command in Terminal it opens a new Adobe Premiere instance and no action is taken.

Thanks, and sorry if it's my fault...

Translate
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 ,
Feb 09, 2015 Feb 09, 2015

Currently yes, a new instance will be launched each time, on Mac. We understand that's probably not the behavior you're looking for; A feature, "Run script in already-open PPro Mac, if available", has already been requested; I'll add your vote.

Translate
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 ,
Feb 10, 2015 Feb 10, 2015

Hi, thanks, but this only answer the first part, but no answer the second part: 'no action is taken'.

I'm writing in Terminal:

admin$ /Applications/Adobe\ Premiere\ Pro\ CC\ 2014/Adobe\ Premiere\ Pro\ CC\ 2014.app/Contents/MacOS/Adobe\ Premiere\ Pro\ CC\ 2014 /C es.processFile "alert('Hello');"

And a new Adobe Premiere opens without any action taken (no alert dialog appears)

I tried the same in a Windows machine, just to check the command line parameters:

cmd.png

And in the already opened Adobe Premiere instance an error dialog appears showing that it can't open the project /C es.processFile "alert('whee!')", because this file path doesn't exists in disk:

error.png

Are you sure these are the correct command parameters?

Thanks a lot,

Translate
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 ,
Feb 10, 2015 Feb 10, 2015

I'm looking at PPro's source code for processing command line arguments, so...yes.

Error on my part; when passing a script directly, and not a path, use 'es.process', not 'es.processFile'.

I'll look into it further.

Translate
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 ,
Feb 10, 2015 Feb 10, 2015

Okay, I found the Important Detailâ„¢ I'd forgotten to mention...

In order to have PPro respond to scripts passed to it from the command line, there must be a file named 'extendscriptprqe.txt' (contents of file don't matter), next to the application itself (just the .app, you don't have to drill down into package contents on MacOS). I happened to have that file present from previous testing, which is why it worked here for me.

Does that work better?

Translate
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 ,
Feb 11, 2015 Feb 11, 2015

Ok,I still have more doubts than when I wrote my initial question:

  • I created the file 'extendscriptprqe.txt' next to the .app, and now it works partially, because when I execute:

          /.../Adobe\ Premiere\ Pro\ CC\ 2014 /C es.process "alert('Hello');"

          Why I say partially? Because the alert appears, but before any PremierePro window is launching or any project (previous) is loaded, what pointed me that no useful script could be  used in this scenario.

  • If I execute the simplest PPro script I can: /.../Adobe\ Premiere\ Pro\ CC\ 2014 /C es.process "app.enableQE();qe.source.openFilePath('/Volumes/LaCIE/MEDIA/xxxxx.mxf');" I got an exception that start like this (I don´t include all the Exception stack to avoid make this unreadable:

          <140735216841488> <Contract Violation> <0> inProject != NULL [/cloudroom/releases/2014.09/PremierePro/Mezzanine/Src/ProjectActions.cpp-4452]

  • If I try the same command in a Windows machine nothing new happens, the same error than before:

Sin título.png

Thanks,

Regards,

Translate
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 ,
Feb 11, 2015 Feb 11, 2015

         Why I say partially? Because the alert appears, but before any PremierePro window is launching or any project (previous) is loaded, what pointed me that no useful script could be  used in this scenario.

That's correct behavior; many scripts open a project. You need a project open before you can do many things.

If you'd like to talk through how best to support your workflow, write me directly at b b b at adobe dot com.

Translate
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 ,
Dec 17, 2017 Dec 17, 2017
LATEST

I was struggling with running a jsx from commandline as well.

The solution for me was to put the jsx file in the default folder for adobe scripts: "/documents/Adobe Scripts". Whenever a script is launched from that location, it is from a trusted location and no warning will pop-up.

I got the information from this blog:

Saina Blog: How to run JS in ESTK with Command line

Translate
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