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

After Effects Crashes When Executing JSX Script via Command Line (-r Option)

New Here ,
Sep 06, 2024 Sep 06, 2024

Copy link to clipboard

Copied

 

I'm trying to run an ExtendScript (JSX) in Adobe After Effects 2024 using the command line option -r to execute the script. However, every time I attempt to run the command, After Effects crashes.

What I've tried:

  • Using ExtendScript directly: When I manually open the .aep project file, wait 15 seconds, and then run the JSX script via the ExtendScript toolkit, it does not crash, but nothing happens.
  • Running the script via the command line: It crashes as soon as I try to execute it with the -r option.

My setup:

  • Operating System: Windows 10
  • After Effects Version: Adobe After Effects 2024
  • Script: A JSX script that opens a project, saves a backup with the suffix "_backup", and suppresses dialog boxes during execution using app.beginSuppressDialogs() and app.endSuppressDialogs(false).

Command I'm using:

 

"C:/Program Files/Adobe/Adobe After Effects 2024/Support Files/afterfx.exe" -r "C:/Users/Shadow/Keyframe Studio Dropbox/EP/Scripts/generated_script.jsx"

 

 

What the script does:

  1. Opens an existing project.
  2. Saves a backup of the project with the suffix "_backup" in the same directory.
  3. Suppresses dialog boxes (e.g., font warnings, GPU warnings) during execution.

 

Here is a simplified version of the script:


// Suppress dialog boxes
app.beginSuppressDialogs();

// Open the project
var projectFilePath = "C:/Users/Shadow/Keyframe Studio Dropbox/EP/Projet/anglais/master.aep";
var my_file = new File(projectFilePath);

if (my_file.exists) {
    var new_project = app.open(my_file);
    if (new_project) {
        // Save project with "_backup" suffix
        var folderPath = new_project.file.parent.fsName;
        var originalFileName = new_project.file.name.split(".")[0];
        var backupFileName = originalFileName + "_backup.aep";
        var backupFilePath = folderPath + "/" + backupFileName;

        var backupFile = new File(backupFilePath);
        app.project.save(backupFile);
    }
} else {
    $.writeln("Project file does not exist.");
}

// Re-enable dialog boxes
app.endSuppressDialogs(false);
​

 

Problem: After Effects crashes every time I try to execute the script using the command line. However, when I manually open the project file and wait 15 seconds before running the script via ExtendScript, the script does not crash, but also does nothing. I’ve already tried:

  • Running After Effects with enough delay (15 seconds) to ensure the project is fully loaded before executing the script.
  • Manually opening After Effects and running the script via the UI works fine, but the command line method keeps crashing.

 

Has anyone experienced similar issues with After Effects crashing when running JSX scripts via -r from the command line? Any insights or solutions would be greatly appreciated!

Thanks in advance!

Bug Unresolved
TOPICS
Performance , Scripting , Troubleshooting

Views

206

Translate

Translate

Report

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
3 Comments
New Here ,
Sep 14, 2024 Sep 14, 2024

Copy link to clipboard

Copied

Hi there, I am having the same problem, Were you able to find a fix for the issue?

 

Thanks

Votes

Translate

Translate

Report

Report
Enthusiast ,
Sep 14, 2024 Sep 14, 2024

Copy link to clipboard

Copied

You should try:

"C:/Program Files/Adobe/Adobe After Effects 2024/Support Files/afterfx.exe" -s $.evalFile("C:/Users/Shadow/Keyframe Studio Dropbox/EP/Scripts/generated_script.jsx")

Votes

Translate

Translate

Report

Report
New Here ,
Sep 14, 2024 Sep 14, 2024

Copy link to clipboard

Copied

LATEST

That worked for me Airweb_AE, thanks for the quick response and great answer.

Votes

Translate

Translate

Report

Report