diff --git a/node-agent.exe~ b/node-agent.exe~ index 70e50a8..dcc7be8 100644 Binary files a/node-agent.exe~ and b/node-agent.exe~ differ diff --git a/services/node-agent/internal/runner/scan.go b/services/node-agent/internal/runner/scan.go index 150e376..d1158e9 100644 --- a/services/node-agent/internal/runner/scan.go +++ b/services/node-agent/internal/runner/scan.go @@ -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 diff --git a/services/node-agent/internal/runner/scan.jsx b/services/node-agent/internal/runner/scan.jsx index abfd828..613c8be 100644 --- a/services/node-agent/internal/runner/scan.jsx +++ b/services/node-agent/internal/runner/scan.jsx @@ -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);