INNER CODE UNIT · TypeScript
thirtySecondsAgo
Dakkshin/after-effects-mcp · src/index.ts:55
const thirtySecondsAgo = new Date(Date.now() - 30 * 1000);
if (stats.mtime < thirtySecondsAgo) {
console.error(`WARNING: Result file is older than 30 seconds. After Effects may not be updating results.`);
return JSON.stringify({
warning: "Result file appears to be stale (not recently updated).",
message: "This could indicate After Effects is not properly writing results or the MCP Bridge Auto panel isn't running.",
lastModified: stats.mtime.toISOString(),
originalContent: content
});
}
return content;
} else {
console.error(`Result file not found at: ${tempFilePath}`);
return JSON.stringify({ error: "No results file found. Please run a script in After Effects first." });
}
} catch (error) {
console.error("Error reading results file:", error);