'Run a .jsx file using Windows Batch
I'm trying to run a Adobe Script in Premiere using Windows Batch.
Is this possible at all?
Solution 1:[1]
I found nothing about this, so I hacked my own solution.
You need to use Windows Batch to:
-Run Premiere
@echo off
Start "" "enter path for premiere.exe here"
Then I followed this tutorial:
https://syntaxfix.com/question/16342/press-keyboard-keys-using-a-batch-file
Here I added
TIMEOUT /T 7
To wait for Premiere to open,
then
rem Use %SendKeys% to send keys to the keyboard buffer
set SendKeys=CScript //nologo //E:JScript "%~F0"
rem Start the other program in the same Window
start "" "link for Visual Studio Code" "folder path you want to open" "file path you want to open"
next I used the shortcut Ctrl shift A to define a target engine, press premi, then F5. I give it some time, then I stop debugging. All done through bash
TIMEOUT /T 2
set /P "=Wait and send a command: " < NUL
ping -n 5 -w 1 127.0.0.1 > NUL
%SendKeys% "^+{A}"
set /P "=Wait and send a command: " < NUL
ping -n 5 -w 1 127.0.0.1 > NUL
%SendKeys% "premi~"
set /P "=Wait and send a command: " < NUL
ping -n 5 -w 1 127.0.0.1 > NUL
%SendKeys% "{F5}"
TIMEOUT /T 5
set /P "=Wait and send a command: " < NUL
ping -n 5 -w 1 127.0.0.1 > NUL
%SendKeys% "+{F5}"
goto :EOF
@end
// JScript section
var WshShell = WScript.CreateObject("WScript.Shell");
WshShell.SendKeys(WScript.Arguments(0));
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | kanjas |