No internet connection
  1. Home
  2. How to

Running a script in Adobe Premiere

By Andrew Sherman @Andrew_Sherman
    2022-01-15 08:25:16.107Z

    I'm trying to find a way to launch scripts in Adobe Premiere. I have scripts working nicely in Adobe Illustrator, After Effects and Photoshop, but unfortunately Premiere doesn't offer script access via a menu item so I have to find another way.

    I found an Adobe website that outlines a method of launching scripts in After Effects using the command line (the example below is for Windows). I'm hoping that I can use this method, with tweaks in Premiere on Mac.

    https://helpx.adobe.com/after-effects/using/scripts.html

    To run a script from the command line, call afterfx.exe from the command line. Use the -r switch and the full path of the script to run as arguments. This command does not open a new instance of the After Effects application; it runs the script in the existing instance.

    Example (for Windows):

    afterfx -r c:\script_path\example_script.jsx

    This is what I'm trying:

    const premiereID = "com.adobe.PremierePro.22";
    const premiere = sf.ui.app(premiereID);
    const premiereLocation = "/Applications/Adobe Premiere Pro 2022/Adobe Premiere Pro 2022.app";
    const scriptLocation = "/path/Scripts/Premiere-NewSequence.jsx";
    
    premiere.appActivate();
    
    sf.engine.runInBackground(() => {
    
        sf.system.exec({
            commandLine: `"${premiereLocation}" -r "${scriptLocation}"`,
            executionMode: 'Background',
        });
    
    });
    

    I'm getting an error from my command-line process:
    "zsh: permission denied: /Applications/Adobe Premiere Pro 2022/Adobe Premiere Pro 2022.app"

    • 6 replies
    1. You can do it like this:

      
      const scriptPath = '/Applications/Adobe After Effects 2022/Scripts/Demo Palette.jsx';
      
      sf.system.execAppleScript({
          script: `
      tell application "Adobe After Effects 2022"
              DoScriptFile "${scriptPath}"
      end tell
          `
      });
      
      1. Oops that was for After Effects. Hopefully it's the same in Premiere :)

        1. Actually it looks like it's different for Premiere, unfortunately.

          1. AAndrew Sherman @Andrew_Sherman
              2022-01-18 19:59:13.464Z

              Thanks for trying that Christian,
              I'll keep trying different methods and will let you know if I find something that works

        2. D
          In reply toAndrew_Sherman:
          DJH @DJH
            2022-02-15 05:47:47.970Z

            I think you can run scripts in premiere with this...
            https://knightsoftheeditingtable.com/excalibur

            1. AAndrew Sherman @Andrew_Sherman
                2022-02-15 09:25:04.276Z

                Thank, yes I use Excalibur and I've been in contact with the developer, but launching scripts with it is not yet working for me. I'm looking for a way to do it using Soundflow that bypasses third-party extensions.