fix(scan): launch AE with the project as arg to bypass the Home screen
Build backend images / build content-svc (push) Failing after 1m13s
Build backend images / build file-svc (push) Failing after 1m35s
Build backend images / build gateway (push) Failing after 57s
Build backend images / build identity-svc (push) Failing after 1m28s
Build backend images / build notification-svc (push) Failing after 53s
Build backend images / build render-svc (push) Failing after 1m4s
Build backend images / build studio-svc (push) Failing after 55s

afterfx -r alone leaves AE on its empty Home/Start screen, which blocks the
script from running (AE sits idle on Untitled Project until the scan times out).
Now launch 'afterfx <aep> -r scan.jsx' so the project opens directly; scan.jsx
uses the already-open project and only app.open()s as a fallback.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
soroush.asadi
2026-06-04 21:13:16 +03:30
parent 010f975a0e
commit 47dd87c60b
3 changed files with 17 additions and 2 deletions
BIN
View File
Binary file not shown.
+10 -1
View File
@@ -47,7 +47,16 @@ func RunScan(ctx context.Context, afterfxPath, aepPath, workDir, outPath, mode s
if mode == "" {
mode = "flexible"
}
cmd := exec.CommandContext(ctx, afterfxPath, "-r", scriptPath)
// Pass the project AS AN ARGUMENT so AE opens it directly on launch — this
// bypasses the Home/Start screen, which otherwise blocks the -r script from
// running (AE sits idle on an empty "Untitled Project"). The script then uses
// the already-open project.
args := []string{}
if aepPath != "" {
args = append(args, aepPath)
}
args = append(args, "-r", scriptPath)
cmd := exec.CommandContext(ctx, afterfxPath, args...)
cmd.Env = append(os.Environ(), "FR_SCAN_AEP="+aepPath, "FR_SCAN_OUT="+outPath, "FR_SCAN_MODE="+mode)
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
+7 -1
View File
@@ -223,7 +223,13 @@
// real project never hangs the headless scan waiting for a click.
try { app.beginSuppressDialogs(); } catch (e) {}
try { app.preferences.savePrefAsLong("Misc Section", "Play sound when render finishes", 0, PREFType.PREF_Type_MACHINE_INDEPENDENT); } catch (e) {}
if (aepPath) app.open(new File(aepPath));
// AE is usually launched WITH the project as an argument (so the Home screen
// can't block us); only open it ourselves if nothing is loaded yet.
var hasProject = false;
try { hasProject = !!(app.project && app.project.file); } catch (e) {}
if (!hasProject && aepPath) {
try { app.open(new File(aepPath)); } catch (e) {}
}
var proj = app.project;
var result = (mode === "fix" || mode === "musicvisualizer") ? scanFix(proj) : scanFlexible(proj);