I have a windows batch file and at the end of script I would like to run an After…
- User
I have a windows batch file and at the end of script I would like to run an After Effects Script (script name is "after_effects_script.jsx". How can I achieve this?
- Assistant
To run an After Effects script (.jsx) from a Windows batch file, you need to call the Adobe After Effects application from the command line and pass the script you want to execute as an argument. This is assuming you have Adobe After Effects installed on your Windows system.
Here's a step-by-step guide on how to do this:
-
Locate the After Effects executable file (
AfterFX.exe). It is usually installed in a path similar toC:\Program Files\Adobe\Adobe After Effects [version]\Support Files. -
In your batch file, use the
startcommand or just call the executable with the appropriate flags to execute the script.
The batch file content would look like this:
@echo off REM The path to AfterFX.exe may change depending on the After Effects version and installation directory set AfterFXPath="C:\Program Files\Adobe\Adobe After Effects [version]\Support Files\AfterFX.exe" set ScriptPath="C:\path\to\your\after_effects_script.jsx" REM Call After Effects with the script "%AfterFXPath%" -r %ScriptPath% REM The rest of your batch commands follow here -
- User
It does not trigger script file Here is a part of my script: start "" /wait "C:\Program Files\Adobe\Adobe After Effects 2023\Support Files\AfterFX.exe" "%destination_folder%%prefixed_project_name%.aep" set AfterFXPath="C:\Program Files\Adobe\Adobe After Effects 2023\Support Files\AfterFX.exe" set ScriptPath="U:\97 PERSONAL\MEHMET\AL JAZEERA SCRIPTS\Create 1PE\after_effects_script.jsx"
- Assistant
- User
Please write a simple after effects script so we can check if script runs or not
- Assistant
To check if the After Effects script is running properly from a batch file, we can write a simple JSX script that will create a text layer in your currently open project in After Effects.
Create a file named
simple_test_script.jsxand write the following JavaScript code into it: - User
- Assistant
- User
Unfortunately it still does not trigger after effects script
- Assistant
- User
'""C:\Program' is not recognized as an internal or external command, operable program or batch file.
- Assistant
The error message you're seeing typically results from improperly quoted paths in a command line or batch file. In Windows batch files, it's crucial to handle spaces in file paths correctly by using quotes. However, it looks like there might be an instance of double-quotes being used improperly around the file path.
Here's how you should format the command in your batch script:
"C:\Program Files\Adobe\Adobe After Effects 2023\Support Files\AfterFX.exe" -r "U:\97 PERSONAL\MEHMET\AL JAZEERA SCRIPTS\Create 1PE\after_effects_script.jsx"This command should be on one line with no extra quotes at the start, as you mentioned in your error message (
'""C:\Program'). To test if this is working, try running this command directly in a Command Prompt.In case you are still facing the issue, review your batch script and look for any place where there may be mismatched quotes around your paths. Sometimes copying and pasting code or editing paths can introduce these errors. If you're unsure, you could post the exact line from your batch file that is causing the problem here, and I can help you correct it.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.