Extendscript & After Effects with .bat
Hey Folks,
I'm relatively new to scripting, picked little bits up here and there.
Trying to automate some tasks I carry our on a regular basis.
I have AE Projects that I'd like to automate using a .bat file to kick things off by opening AE, a particular AE Project, open ExtendScript and then run a script in ExtendScript to batch generate graphics and animations.
I've tried this ...
@2846721 off
REM Path to After Effects executable
set AE_PATH="C:\Program Files\Adobe\Adobe After Effects 2024\Support Files\AfterFX.exe"
REM Path to the After Effects project
set PROJECT_PATH="D:\OneDrive\Gartcairn FC\Gartcairn FC Fixture Graphics.aep"
REM Path to the ExtendScript Toolkit executable
set ESTK_PATH="C:\Program Files (x86)\Adobe\Adobe ExtendScript Toolkit CC\ExtendScript Toolkit.exe"
REM Path to the JavaScript file
set SCRIPT_PATH="C:\GARTCAIRN Fixtures.jsx"
REM Open After Effects project
%AE_PATH% -project %PROJECT_PATH%
REM Wait for After Effects to open the project
timeout /t 10
REM Open ExtendScript Toolkit and run the script
start "" %ESTK_PATH% %SCRIPT_PATH%
and also split these into 2 (open ExtendScript, open script, run script) but things seem to stall until I close AE.
I've tried the .bat to open the script in ExtendScript and then run it, it opens fine but won't run the script.
The script works perfectly if I manually open the AE project, open the script in ExtendScript and then click the Start icon.
Any ideas what's missing? Do I need to tweak the .bat file or totally rethink the process?
Thanks in advance
