From cd47f06a98f6a6f87275b8f86409d35c9e826de3 Mon Sep 17 00:00:00 2001 From: John Haugabook Date: Tue, 10 Nov 2026 23:13:57 -0500 Subject: [PATCH 01/13] new plugin adobe-after-effects --- .github/plugin/marketplace.json | 6 + agents/adobe-creative-cloud.agent.md | 15 +- docs/README.agents.md | 2 +- docs/README.plugins.md | 1 + docs/README.skills.md | 2 + plugins/adobe-after-effects/README.md | 62 +++ plugins/adobe-after-effects/plugin.json | 34 ++ .../adobe-after-effects-integrations/SKILL.md | 189 ++++++++ .../references/bridges-and-mcp.md | 151 ++++++ .../references/cep.md | 202 ++++++++ .../references/cpp-sdk.md | 155 ++++++ skills/adobe-after-effects-scripting/SKILL.md | 441 ++++++++++++++++++ .../references/command-line.md | 108 +++++ .../references/object-model.md | 147 ++++++ 14 files changed, 1509 insertions(+), 6 deletions(-) create mode 100644 plugins/adobe-after-effects/README.md create mode 100644 plugins/adobe-after-effects/plugin.json create mode 100644 skills/adobe-after-effects-integrations/SKILL.md create mode 100644 skills/adobe-after-effects-integrations/references/bridges-and-mcp.md create mode 100644 skills/adobe-after-effects-integrations/references/cep.md create mode 100644 skills/adobe-after-effects-integrations/references/cpp-sdk.md create mode 100644 skills/adobe-after-effects-scripting/SKILL.md create mode 100644 skills/adobe-after-effects-scripting/references/command-line.md create mode 100644 skills/adobe-after-effects-scripting/references/object-model.md diff --git a/.github/plugin/marketplace.json b/.github/plugin/marketplace.json index f0da5c6f65..eadfe749bd 100644 --- a/.github/plugin/marketplace.json +++ b/.github/plugin/marketplace.json @@ -47,6 +47,12 @@ "description": "Drive Microsoft AgentRC from Copilot chat: assess AI readiness, generate Copilot instructions (flat or nested with applyTo globs for monorepos), and manage policies. Produces a self-contained static HTML dashboard at reports/index.html.", "version": "1.0.0" }, + { + "name": "adobe-after-effects", + "source": "plugins/adobe-after-effects", + "description": "Adobe After Effects scripting and expressions, CEP and UXP panels, C++ SDK plugins, MCP and command-line automation, and renders through the render queue, aerender, and Media Encoder, led by an expert technical artist agent for Adobe Creative Cloud.", + "version": "1.0.0" + }, { "name": "adobe-illustrator", "source": "plugins/adobe-illustrator", diff --git a/agents/adobe-creative-cloud.agent.md b/agents/adobe-creative-cloud.agent.md index 5ae014d93e..a7110b47e7 100644 --- a/agents/adobe-creative-cloud.agent.md +++ b/agents/adobe-creative-cloud.agent.md @@ -1,25 +1,27 @@ --- name: 'Adobe Creative Cloud' -description: 'Expert technical artist for Adobe Creative Cloud: picks the right app or combination of apps (Illustrator, Photoshop, InDesign, After Effects, and more), knows Creative Cloud storage (cloud documents, Projects, Libraries, Stock, local files), moving work off discontinued apps, and how each app is extended (scripts, CEP extensions, UXP and C++ plug-ins, MCP servers). Leads the adobe-illustrator-scripting and adobe-illustrator-integrations skills for Illustrator scripts, extensions, plug-ins, automation, and asset management.' +description: 'Expert technical artist for Adobe Creative Cloud: picks the right app or combination of apps (Illustrator, Photoshop, InDesign, After Effects, and more), knows Creative Cloud storage (cloud documents, Projects, Libraries, Stock, local files), moving work off discontinued apps, and how each app is extended (scripts, CEP extensions, UXP and C++ plug-ins, MCP servers). Leads the adobe-illustrator-scripting and adobe-illustrator-integrations skills for Illustrator scripts, extensions, plug-ins, automation, and asset management, and the adobe-after-effects-scripting and adobe-after-effects-integrations skills for After Effects scripts, expressions, panels, plugins, automation, and renders.' model: 'Claude Sonnet 5.5' --- # Adobe Creative Cloud Technical Artist -You are an expert technical artist for Adobe Creative Cloud, with the depth of a computer science PhD and the eye of a trained graphic designer. You explain design choices in design terms (hierarchy, rhythm, contrast, color, type) and implementation choices in engineering terms (data flow, error handling, versions, performance). You are most hands-on with Adobe Illustrator. +You are an expert technical artist for Adobe Creative Cloud, with the depth of a computer science PhD and the eye of a trained graphic designer. You explain design choices in design terms (hierarchy, rhythm, contrast, color, type) and implementation choices in engineering terms (data flow, error handling, versions, performance). You are most hands-on with Adobe Illustrator and After Effects. ## Skills You Lead - **adobe-illustrator-scripting**: the Illustrator ExtendScript DOM (documents, layers, paths, text, color, artboards, exports). Use it for any script that changes or reads artwork. - **adobe-illustrator-integrations**: everything around a script (CEP extension panels, C++ plug-ins, the coming UXP plugins, MCP servers, command-line and OS automation, computer use, and docs for published tools). +- **adobe-after-effects-scripting**: After Effects ExtendScript and expressions (projects, compositions, layers, properties, keyframes, effects, text, the render queue, `aerender`, and running scripts from outside). Use it for any code After Effects runs. +- **adobe-after-effects-integrations**: what runs beside or inside After Effects (CEP panels, UXP plugins from the 27.0 beta, C++ effect, AEGP, and AEIO plugins, and MCP servers and other bridges that drive it). -Load the skill that matches the task before writing code, and use both when a panel, server, or pipeline wraps a script. +Load the skill that matches the app and the task before writing code, and use both of an app's skills when a panel, server, or pipeline wraps a script. Each plugin installs its own app's skills; when the matching skill is not installed, say so and work from the app's scripting guide. ## How You Work - Pick the lowest integration tier that meets the need: manual steps, then a script, a CEP panel, a plug-in, an MCP server, or an OS script. - Keep the core in plain ExtendScript functions that take a settings object and return a result string, so any front end can call them. -- Verify on a copy of a real document inside the app: run it, export a PNG, and compare it with what was asked for. +- Verify on a copy of a real document or project inside the app: run it, export a PNG or render a frame, and compare it with what was asked for. ## Choosing Apps @@ -58,7 +60,7 @@ Status as of November 2026; check Adobe's pages for changes. | Photoshop (with Camera Raw) | Desktop, web, mobile | Active | ExtendScript; UXP scripts and plugins (since 2020); CEP (being retired); C++ SDK | | InDesign | Desktop | Active | ExtendScript; UXP scripts and plugins (since 2023); CEP; C++ SDK | | InCopy | Desktop | Active | ExtendScript; C++ (InDesign SDK) | -| After Effects | Desktop | Active | ExtendScript, expressions; CEP; C++ effects SDK; UXP public beta by November 2026 | +| After Effects | Desktop | Active | ExtendScript, expressions; CEP; C++ SDK (effects, AEGP, AEIO); UXP plugins from the 27.0 beta | | Premiere Pro, Premiere (mobile) | Desktop, mobile | Active | ExtendScript; UXP plugins (GA); CEP (being retired); C++ SDK | | Media Encoder | Desktop | Active | ExtendScript; CEP; UXP public beta | | Audition | Desktop | Active | CEP panels, limited scripting | @@ -138,9 +140,12 @@ Adobe's words, which differ by app: For Illustrator today: scripts for automation, CEP for panels, C++ for tools, effects, and speed, and UXP once its public beta ships (by Spring 2027). +For After Effects today: scripts and expressions for automation, ScriptUI or CEP for panels, C++ for effects and native hooks, `aerender` or Media Encoder for renders, and UXP once 27.0 leaves beta. + ## MCP Servers and Computer Use - **Illustrator MCP servers** run ExtendScript in Illustrator through COM (Windows) or AppleScript (macOS) and expose tools to an AI agent. Before using a community server, read what code it runs in Illustrator, which folders it writes, and whether it accepts arbitrary code; pin a version. To build one, use the adobe-illustrator-integrations skill (allowlisted scripts, PNG previews, no saving over open files). +- **After Effects MCP servers** reach After Effects through `AfterFX.exe -r` or `-s` (AppleScript on macOS), a file mailbox, a CEP panel server, or an AEGP, and every command runs on its main thread. Vet community servers the same way. To build one, use the adobe-after-effects-integrations skill (specific tools, one command at a time, an undo group per call, no run-anything tool by default). - **Computer-use MCPs** drive the screen. Use them only for UI with no scripting route (some panels, dialogs, generative features). Work on a copy, prefer menu paths and shortcuts to coordinates, take a screenshot after each step, confirm with a script readback, and stop on any unexpected dialog. ## Project and Workspace Files diff --git a/docs/README.agents.md b/docs/README.agents.md index 6a2963e011..8569ef77a2 100644 --- a/docs/README.agents.md +++ b/docs/README.agents.md @@ -22,7 +22,7 @@ See [CONTRIBUTING.md](../CONTRIBUTING.md#adding-agents) for guidelines on how to | [.NET Upgrade](../agents/dotnet-upgrade.agent.md)
[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/agent?url=vscode%3Achat-agent%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fagents%2Fdotnet-upgrade.agent.md)
[![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/agent?url=vscode-insiders%3Achat-agent%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fagents%2Fdotnet-upgrade.agent.md) | Perform janitorial tasks on C#/.NET code including cleanup, modernization, and tech debt remediation. | | [Accessibility Expert](../agents/accessibility.agent.md)
[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/agent?url=vscode%3Achat-agent%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fagents%2Faccessibility.agent.md)
[![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/agent?url=vscode-insiders%3Achat-agent%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fagents%2Faccessibility.agent.md) | Expert assistant for web accessibility (WCAG 2.1/2.2), inclusive UX, and a11y testing | | [Accessibility Runtime Tester](../agents/accessibility-runtime-tester.agent.md)
[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/agent?url=vscode%3Achat-agent%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fagents%2Faccessibility-runtime-tester.agent.md)
[![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/agent?url=vscode-insiders%3Achat-agent%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fagents%2Faccessibility-runtime-tester.agent.md) | Runtime accessibility specialist for keyboard flows, focus management, dialog behavior, form errors, and evidence-backed WCAG validation in the browser. | -| [Adobe Creative Cloud](../agents/adobe-creative-cloud.agent.md)
[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/agent?url=vscode%3Achat-agent%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fagents%2Fadobe-creative-cloud.agent.md)
[![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/agent?url=vscode-insiders%3Achat-agent%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fagents%2Fadobe-creative-cloud.agent.md) | Expert technical artist for Adobe Creative Cloud: picks the right app or combination of apps (Illustrator, Photoshop, InDesign, After Effects, and more), knows Creative Cloud storage (cloud documents, Projects, Libraries, Stock, local files), moving work off discontinued apps, and how each app is extended (scripts, CEP extensions, UXP and C++ plug-ins, MCP servers). Leads the adobe-illustrator-scripting and adobe-illustrator-integrations skills for Illustrator scripts, extensions, plug-ins, automation, and asset management. | +| [Adobe Creative Cloud](../agents/adobe-creative-cloud.agent.md)
[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/agent?url=vscode%3Achat-agent%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fagents%2Fadobe-creative-cloud.agent.md)
[![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/agent?url=vscode-insiders%3Achat-agent%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fagents%2Fadobe-creative-cloud.agent.md) | Expert technical artist for Adobe Creative Cloud: picks the right app or combination of apps (Illustrator, Photoshop, InDesign, After Effects, and more), knows Creative Cloud storage (cloud documents, Projects, Libraries, Stock, local files), moving work off discontinued apps, and how each app is extended (scripts, CEP extensions, UXP and C++ plug-ins, MCP servers). Leads the adobe-illustrator-scripting and adobe-illustrator-integrations skills for Illustrator scripts, extensions, plug-ins, automation, and asset management, and the adobe-after-effects-scripting and adobe-after-effects-integrations skills for After Effects scripts, expressions, panels, plugins, automation, and renders. | | [ADR Generator](../agents/adr-generator.agent.md)
[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/agent?url=vscode%3Achat-agent%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fagents%2Fadr-generator.agent.md)
[![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/agent?url=vscode-insiders%3Achat-agent%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fagents%2Fadr-generator.agent.md) | Expert agent for creating comprehensive Architectural Decision Records (ADRs) with structured formatting optimized for AI consumption and human readability. | | [AEM Front End Specialist](../agents/aem-frontend-specialist.agent.md)
[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/agent?url=vscode%3Achat-agent%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fagents%2Faem-frontend-specialist.agent.md)
[![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/agent?url=vscode-insiders%3Achat-agent%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fagents%2Faem-frontend-specialist.agent.md) | Expert assistant for developing AEM components using HTL, Tailwind CSS, and Figma-to-code workflows with design system integration | | [Agent Governance Reviewer](../agents/agent-governance-reviewer.agent.md)
[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/agent?url=vscode%3Achat-agent%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fagents%2Fagent-governance-reviewer.agent.md)
[![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/agent?url=vscode-insiders%3Achat-agent%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fagents%2Fagent-governance-reviewer.agent.md) | AI agent governance expert that reviews code for safety issues, missing governance controls, and helps implement policy enforcement, trust scoring, and audit trails in agent systems. | diff --git a/docs/README.plugins.md b/docs/README.plugins.md index 128cbbdc20..26511c5185 100644 --- a/docs/README.plugins.md +++ b/docs/README.plugins.md @@ -29,6 +29,7 @@ See [CONTRIBUTING.md](../CONTRIBUTING.md#adding-plugins) for guidelines on how t | ---- | ----------- | ----- | ---- | | [accessibility-kanban](../plugins/accessibility-kanban/README.md) | Kanban board to manage accessibility issues, allow you to plan, track, and complete remediation work. | 1 items | accessibility, github-issues, issue-triage, kanban-board, planning-workflow, status-tracking | | [acreadiness-cockpit](../plugins/acreadiness-cockpit/README.md) | Drive Microsoft AgentRC from Copilot chat: assess AI readiness, generate Copilot instructions (flat or nested with applyTo globs for monorepos), and manage policies. Produces a self-contained static HTML dashboard at reports/index.html. | 4 items | agentrc, ai-readiness, copilot-instructions, readiness-report, monorepo, policy, dashboard | +| [adobe-after-effects](../plugins/adobe-after-effects/README.md) | Adobe After Effects scripting and expressions, CEP and UXP panels, C++ SDK plugins, MCP and command-line automation, and renders through the render queue, aerender, and Media Encoder, led by an expert technical artist agent for Adobe Creative Cloud. | 3 items | adobe-after-effects, after-effects, extendscript, expressions, cep, uxp, motion-graphics, creative-cloud, automation, mcp | | [adobe-illustrator](../plugins/adobe-illustrator/README.md) | Adobe Illustrator scripting, extension and plug-in development, MCP and command-line automation, and Creative Cloud asset management, led by an expert technical artist agent for Adobe Creative Cloud. | 3 items | adobe-illustrator, illustrator, extendscript, cep, uxp, creative-cloud, graphic-design, automation, mcp | | [agent-radar](../plugins/agent-radar/README.md) | See a live map of the Copilot agents on your computer, their sub-agents, their commands, and where their data goes. | 1 items | agents, canvas, copilot-extension, data-flow, mcp, observability, subagents, token-usage | | [ai-credits-breakdown](../plugins/ai-credits-breakdown/README.md) | See exactly where your own GitHub Copilot AI credits go: dollars by day, repository, model, call type and prompt-cache state, built privately on your computer from your Copilot telemetry. | 1 items | ai-credits, canvas, copilot-extension, cost-tracking, token-usage, usage-analytics | diff --git a/docs/README.skills.md b/docs/README.skills.md index 26484ccb62..b58d6e4284 100644 --- a/docs/README.skills.md +++ b/docs/README.skills.md @@ -33,6 +33,8 @@ See [CONTRIBUTING.md](../CONTRIBUTING.md#adding-skills) for guidelines on how to | [acreadiness-policy](../skills/acreadiness-policy/SKILL.md)
`gh skills install github/awesome-copilot acreadiness-policy` | Help the user pick, write, or apply an AgentRC policy. Policies customise readiness scoring by disabling irrelevant checks, overriding impact/level, setting pass-rate thresholds, or chaining org baselines with team overrides. Use when the user asks about strict mode, AI-only scoring, custom weights, CI gating, or wants org-wide standardisation. | None | | [ad-campaign-analyzer](../skills/ad-campaign-analyzer/SKILL.md)
`gh skills install github/awesome-copilot ad-campaign-analyzer` | Use this skill when the user shares ad campaign performance data and asks what to cut, scale, or test. Trigger for prompts like "analyze my ad campaigns", "where am I wasting ad spend", "reallocate my ad budget", "which ads are actually working", or "ROAS analysis". Do not trigger for campaign planning or creative generation without performance data. | None | | [add-educational-comments](../skills/add-educational-comments/SKILL.md)
`gh skills install github/awesome-copilot add-educational-comments` | Add educational comments to the file specified, or prompt asking for file to comment if one is not provided. | None | +| [adobe-after-effects-integrations](../skills/adobe-after-effects-integrations/SKILL.md)
`gh skills install github/awesome-copilot adobe-after-effects-integrations` | Build, package, install and debug components that run beside or inside Adobe After Effects, and choose between them. Covers CEP extension panels (CSXS/manifest.xml, CSInterface.evalScript, Node.js in a panel, .debug files, PlayerDebugMode, ZXP signing and UPIA installs, and CEP's retirement schedule), UXP plugins (After Effects beta from 27.0), C++ effect, AEGP and AEIO plugins on the After Effects SDK (PiPL, entry points, Multi-Frame Rendering, SmartFX, GPU, AEGP_ExecuteScript, idle hooks), and MCP servers or other bridges that let an AI agent, a pipeline or another application drive After Effects (command-line scripts, file mailboxes polled with app.scheduleTask, loopback servers in a CEP panel, AEGP sockets). Use when deciding how an outside program reaches After Effects, or when building, installing or fixing one of these components. For the ExtendScript or expressions such a component runs inside After Effects, use adobe-after-effects-scripting. | `references/bridges-and-mcp.md`
`references/cep.md`
`references/cpp-sdk.md` | +| [adobe-after-effects-scripting](../skills/adobe-after-effects-scripting/SKILL.md)
`gh skills install github/awesome-copilot adobe-after-effects-scripting` | Automate Adobe After Effects and write, edit, debug or review its scripts and expressions. Covers ExtendScript (.jsx, .jsxbin) and its ECMAScript 3 limits, the object model (app, project, items, folders, compositions, layers, properties, keyframes, effects, text), undo groups, the render queue and the hand-off to Adobe Media Encoder, ScriptUI panels, the Scripts, ScriptUI Panels, Startup and Shutdown folders, running a script from outside with AfterFX.exe -r and -s or AppleScript DoScriptFile, rendering with aerender, and expressions on both expression engines. Use for any code that After Effects itself runs. For CEP or UXP panels, C++ SDK plugins, or an MCP server or other bridge that drives After Effects from another process, use adobe-after-effects-integrations instead; the ExtendScript such a component sends into After Effects is still this skill. | `references/command-line.md`
`references/object-model.md` | | [adobe-illustrator-integrations](../skills/adobe-illustrator-integrations/SKILL.md)
`gh skills install github/awesome-copilot adobe-illustrator-integrations` | Build, debug, package, and document Adobe Illustrator integrations: CEP extension panels, C++ SDK plug-ins (.aip), the coming UXP plugins, MCP servers that drive Illustrator, computer-use automation, and OS scripts (batch, PowerShell, bash, AppleScript) that run ExtendScript in Illustrator. Use when creating or fixing an Illustrator extension or plug-in, choosing between a script, extension, or plug-in, connecting an AI tool to Illustrator, automating Illustrator from the command line, or writing install and usage docs for an Illustrator tool someone will publish. Pairs with adobe-illustrator-scripting for the ExtendScript DOM. | `references/automation-and-mcp.md`
`references/cep-extensions.md`
`references/cpp-plugins.md`
`references/publishing-docs.md` | | [adobe-illustrator-scripting](../skills/adobe-illustrator-scripting/SKILL.md)
`gh skills install github/awesome-copilot adobe-illustrator-scripting` | Write, debug, and optimize Adobe Illustrator automation scripts using ExtendScript (JavaScript/JSX). Use when creating or modifying scripts that manipulate documents, layers, paths, text frames, colors, symbols, artboards, or any Illustrator DOM objects. Covers the complete JavaScript object model, coordinate system, measurement units, export workflows, and scripting best practices. | `references/object-model-quick-reference.md`
`scripts/batch-export-png.jsx`
`scripts/create-color-grid.jsx`
`scripts/find-replace-text.jsx` | | [agent-architecture](../skills/agent-architecture/SKILL.md)
`gh skills install github/awesome-copilot agent-architecture` | Design AI agent architectures through requirements discovery, or audit and diagnose architectural flaws in existing agents. Architecture only; excludes implementation and general code review. | `LICENSE.txt`
`agents/openai.yaml`
`references/architecture-contract.md`
`references/architecture-selection.md`
`references/audit.md`
`references/capability-design.md`
`references/design.md`
`references/diagnostic-review.md`
`references/discovery-protocol.md`
`references/evaluation-design.md`
`references/execution-continuity.md`
`references/result-delivery.md`
`references/scenarios.md`
`references/source-map.md`
`references/validation-loop.md` | diff --git a/plugins/adobe-after-effects/README.md b/plugins/adobe-after-effects/README.md new file mode 100644 index 0000000000..edf9cbbf18 --- /dev/null +++ b/plugins/adobe-after-effects/README.md @@ -0,0 +1,62 @@ +# Adobe After Effects Plugin + +Adobe After Effects scripting and expressions, CEP and UXP panels, C++ SDK plugins, MCP and command-line automation, and renders through the render queue, aerender, and Media Encoder, led by an expert technical artist agent for Adobe Creative Cloud. + +## Installation + +```bash +copilot plugin install adobe-after-effects@awesome-copilot +``` + +## What's Included + +### Agent + +| Agent | What it does | +| --- | --- | +| `Adobe Creative Cloud` | An expert technical artist that picks the right Creative Cloud app or combination of apps, knows Creative Cloud storage (cloud documents, Projects, Libraries, Stock, local files), moves work off discontinued apps, explains how each app is extended, and leads the two skills below. | + +### Skills + +| Skill | What it does | +| --- | --- | +| `adobe-after-effects-scripting` | Writes, debugs, and reviews After Effects ExtendScript and expressions: projects, compositions, layers, properties, keyframes, effects, text, the render queue and the hand-off to Media Encoder, ScriptUI panels, running scripts from outside After Effects, and `aerender`. | +| `adobe-after-effects-integrations` | Builds and fixes what runs beside or inside After Effects: CEP extension panels, UXP plugins from the 27.0 beta, C++ effect, AEGP, and AEIO plugins, and MCP servers or other bridges that let an AI agent or a pipeline drive After Effects. | + +## Use Cases + +- Write or fix an After Effects script, from renaming layers to building compositions from footage and data +- Write or debug an expression, and choose the expression engine a project should use +- Build compositions from a template with a script, then render them through the render queue, `aerender`, or Media Encoder +- Run After Effects scripts unattended from a batch file, PowerShell, a scheduler, or CI, with results written to a file +- Build or fix a ScriptUI panel or a CEP extension panel for After Effects +- Plan a C++ effect or AEGP plugin on the After Effects SDK, or a UXP plugin for the 27.0 beta +- Build or vet an MCP server that lets an AI tool drive After Effects +- Choose between After Effects, Premiere Pro, Illustrator, and Media Encoder for a motion job, and move assets between them + +## Example Prompts + +```text +Write an After Effects script that builds a 1080 x 1080, 30 fps composition named Acme Promo +from every clip in a footage folder, one after another with a half-second crossfade, and adds +a lower third that reads "Acme Corp" over the first three seconds. +``` + +```text +Write an expression for a logo layer's Gaussian Blur that stays at 0 until the last 20% of +the layer named "music", then rises to 40 by the end of the composition. +``` + +```text +Design an MCP server for After Effects with tools to describe the open project, add a text +layer, and queue a render to a given folder, using AfterFX.exe -s and a result file, and +explain how to register it in VS Code. +``` + +## Source + +This plugin is part of [Awesome Copilot](https://github.com/github/awesome-copilot). + +## License + +MIT diff --git a/plugins/adobe-after-effects/plugin.json b/plugins/adobe-after-effects/plugin.json new file mode 100644 index 0000000000..0f9a446833 --- /dev/null +++ b/plugins/adobe-after-effects/plugin.json @@ -0,0 +1,34 @@ +{ + "$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json", + "name": "adobe-after-effects", + "description": "Adobe After Effects scripting and expressions, CEP and UXP panels, C++ SDK plugins, MCP and command-line automation, and renders through the render queue, aerender, and Media Encoder, led by an expert technical artist agent for Adobe Creative Cloud.", + "version": "1.0.0", + "keywords": [ + "adobe-after-effects", + "after-effects", + "extendscript", + "expressions", + "cep", + "uxp", + "motion-graphics", + "creative-cloud", + "automation", + "mcp" + ], + "author": { + "name": "Awesome Copilot Community" + }, + "repository": "https://github.com/github/awesome-copilot", + "license": "MIT", + "extensions": { + "com.github.awesome-copilot": { + "agents": [ + "./agents/adobe-creative-cloud.md" + ], + "skills": [ + "./skills/adobe-after-effects-integrations/", + "./skills/adobe-after-effects-scripting/" + ] + } + } +} diff --git a/skills/adobe-after-effects-integrations/SKILL.md b/skills/adobe-after-effects-integrations/SKILL.md new file mode 100644 index 0000000000..a4d4159cb3 --- /dev/null +++ b/skills/adobe-after-effects-integrations/SKILL.md @@ -0,0 +1,189 @@ +--- +name: adobe-after-effects-integrations +description: 'Build, package, install and debug components that run beside or inside Adobe After Effects, and choose between them. Covers CEP extension panels (CSXS/manifest.xml, CSInterface.evalScript, Node.js in a panel, .debug files, PlayerDebugMode, ZXP signing and UPIA installs, and CEP''s retirement schedule), UXP plugins (After Effects beta from 27.0), C++ effect, AEGP and AEIO plugins on the After Effects SDK (PiPL, entry points, Multi-Frame Rendering, SmartFX, GPU, AEGP_ExecuteScript, idle hooks), and MCP servers or other bridges that let an AI agent, a pipeline or another application drive After Effects (command-line scripts, file mailboxes polled with app.scheduleTask, loopback servers in a CEP panel, AEGP sockets). Use when deciding how an outside program reaches After Effects, or when building, installing or fixing one of these components. For the ExtendScript or expressions such a component runs inside After Effects, use adobe-after-effects-scripting.' +--- + +# Adobe After Effects Integrations + +Build the things that run beside or inside After Effects: panels, native +plugins, and the bridges an outside program uses to drive it. + +## Scope + +| This skill | adobe-after-effects-scripting | +| --- | --- | +| CEP and UXP panels: manifests, packaging, debugging, installing | The ExtendScript a panel sends with `evalScript` | +| C++ effect, AEGP and AEIO plugins on the After Effects SDK | Scripts run by hand, from the Scripts folders, or with `AfterFX.exe -r` | +| MCP servers and other bridges, and how they reach After Effects | The object model those bridges' scripts use | +| Choosing which kind of component a job needs | Expressions, ScriptUI panels, `aerender` | + +A bridge's process, protocol and security belong here. Every line of +ExtendScript it runs inside After Effects belongs to the scripting skill. + +## Choose the component + +| The job | Build | +| --- | --- | +| Run one automation from a terminal, scheduler or CI | No integration: a script with `AfterFX.exe -r`, or `aerender` to render. See the scripting skill. | +| A panel of buttons and fields, ExtendScript only | A ScriptUI panel. See the scripting skill. | +| A panel with HTML, CSS and Node.js | A CEP extension today; a UXP plugin once After Effects' UXP support leaves beta. See [CEP and UXP](#cep-and-uxp). | +| A new effect that processes pixels or audio | A C++ effect plugin. See [The C++ SDK](#the-c-sdk). | +| Menu commands, idle-time work, deep hooks, or running scripts from native code | An AEGP. | +| Import or export a file format After Effects lacks | An AEIO. | +| An AI agent, pipeline or web application driving After Effects | A bridge, often behind an MCP server. See [Bridges and MCP servers](#bridges-and-mcp-servers). | + +## Versions + +After Effects 2025 is 25.x, 2026 is 26.x, and 2027 is 27.0. Read the version +from the installed `Support Files\AfterFX.exe` on Windows, or `app.version` +from a script, before choosing an API: CEP 12 arrived in 25.0, and UXP support +starts at 27.0. + +## CEP and UXP + +### CEP + +A CEP extension is an HTML page in a Chromium panel that calls After Effects +through ExtendScript. + +- **Layout:** a folder holding `CSXS/manifest.xml`, the panel's HTML and + JavaScript, Adobe's `CSInterface.js` for the matching CEP version, and the + ExtendScript file the manifest names. +- **Host:** After Effects' host ID is `AEFT`. After Effects 25.0 ships CEP 12, + and 26.0 still does: its `Support Files\CEPHtmlEngine\CEPHtmlEngine.exe` is + version 12.0.1, though no Adobe document lists 26.x. Read that file's + version to check an installation. +- **Calling After Effects:** `csInterface.evalScript(script, callback)` runs + ExtendScript on After Effects' main thread and hands the callback a string, + or `"EvalScript error."` when it fails. Serialize results yourself, + because ExtendScript has no `JSON`. Keep every call short: the main thread + is the user interface. +- **Node.js:** `--enable-nodejs` and `--mixed-context` in the manifest's + ``. CEP 12 bundles Node.js 17.7.1 and Chromium 99, so native + modules must be built for that Node.js. +- **Development:** unsigned extensions load only with **PlayerDebugMode** set + for the CEP version (`CSXS.12` for CEP 12). A `.debug` file in the + extension root maps the extension to a port for Chrome DevTools, and must + name `AEFT` itself. +- **Distribution:** sign with `ZXPSignCmd` into a `.zxp`, with a timestamp, + on the platform it will run on, and install with Adobe's Unified Plugin + Installer Agent (UPIA). `ExManCmd` no longer works with Creative Cloud 2022 + apps and later. +- **Limits:** After Effects does not support resizing a panel from code. +- **Scaffolding:** Hyper Brew's Bolt CEP builds CEP extensions with Vite, + TypeScript and React, Svelte or Vue, compiles modern ExtendScript down to + ES3, and packages ZXPs. + +Manifest, folders, debug settings and signing commands are in +[references/cep.md](references/cep.md). + +### CEP's retirement + +Adobe's announcement, published September 2026: After Effects, Illustrator +and Media Encoder **stop accepting new CEP submissions and turn CEP off by +default in December 2028**, users can turn it back on, and **CEP is removed +from these apps at the end of 2029**. Every flagship app gets at least two +years from its UXP public beta before CEP goes. **ExtendScript scripts are not +affected.** A new panel meant to last past 2028 needs a UXP plan. + +### UXP + +- After Effects added UXP plugin support in the **27.0 beta**, first as a + private beta that used a special build of the UXP Developer Tool, with a + public beta announced for November 2026. Check the current status before + building on it. +- Documentation: , where every + API lists 27.0 as its minimum version. The host module is + `require("aftereffects")`. +- The manifest's `host.app` value for After Effects is not yet in the general + UXP manifest documentation; take it from the After Effects UXP pages. +- Bolt UXP lists After Effects only for private-beta participants, and its + hybrid C++ plugins do not support After Effects. + +## The C++ SDK + +- **Get it** from the Adobe Developer Console, linked as "Get the SDKs" from + . Releases follow After Effects + (25.2, 25.6, 26.5, then a 27.0 update for the beta). The guide is at + . +- **Plugin types:** effects, AEGPs (After Effects General Plugins), AEIOs + (input and output), Artisans (3D renderers) and BlitHooks. +- **Entry points:** the samples use `EffectMain()` for effects, a + `PF_Cmd`-dispatching function, and `EntryPointFunc()` for AEGPs. The real + name is whatever the PiPL resource declares. +- **PiPL:** every plugin carries a PiPL resource. On Windows the sample + projects' custom build steps turn the cross-platform `.r` file into an `.rc` + file; on macOS, Rez compiles it. The out flags in the PiPL must match those + set in `GlobalSetup`. +- **Files:** a DLL with the `.aex` extension on Windows, a `.plugin` bundle on + macOS. +- **Install:** installers read + `HKLM\SOFTWARE\Adobe\After Effects\\CommonPluginInstallPath` on + Windows; on macOS the shared folder is + `/Library/Application Support/Adobe/Common/Plug-ins/7.0/MediaCore/` (7.0 for + every Creative Cloud version). After Effects ignores folders whose names + end in a closing parenthesis or start with `~` (Windows) or `¬` (macOS). +- **Multi-Frame Rendering:** set `PF_OutFlag2_SUPPORTS_THREADED_RENDERING` + only once the effect is thread-safe. +- **SmartFX and GPU:** `PF_OutFlag2_SUPPORTS_SMART_RENDER` brings + `PF_Cmd_SMART_PRE_RENDER` and `PF_Cmd_SMART_RENDER`; + `PF_OutFlag2_SUPPORTS_GPU_RENDER_F32` (16.0 and later) with + `PF_Cmd_GPU_DEVICE_SETUP` and `PF_Cmd_SMART_RENDER_GPU` for GPU rendering. +- **Running ExtendScript from C++:** `AEGP_ExecuteScript` in + `AEGP_UtilitySuite6` returns the value of the script's last line. +- **AEGP threading:** none. Every AEGP call happens on the main thread, in a + callback or the idle hook (`AEGP_RegisterIdleHook`). +- **macOS 15 and later** refuse to load unsigned plugins. + +Signatures, the thread-safety rules and build requirements are in +[references/cpp-sdk.md](references/cpp-sdk.md). + +## Bridges and MCP servers + +After Effects has no network API. An outside program reaches it in one of four +ways: + +| Bridge | How it works | Strengths | Costs | +| --- | --- | --- | --- | +| Command line | `AfterFX.exe -r` or `-s` on Windows, AppleScript `DoScriptFile` on macOS, runs a script in the running instance | Nothing to install inside After Effects | No return channel; results go through a file. macOS needs Automation permission. | +| File mailbox | A ScriptUI panel or `Startup` script polls a folder with `app.scheduleTask` and writes results beside the commands | Pure ExtendScript, no ports | Latency of the polling interval; needs the file-access preference | +| CEP panel server | Node.js in a CEP panel listens on loopback and calls `evalScript` per request | Immediate replies, rich panel | A listening socket to secure; tied to CEP's retirement | +| AEGP | A native plugin accepts connections and runs work from its idle hook with `AEGP_ExecuteScript` | Fast, no panel needed | C++, per-platform builds, main-thread-only rules | + +An MCP server sits in front of one of these. The rules that keep it safe and +reliable: + +- **Use stdio** unless something requires HTTP. A stdio server has no + listener at all, and writes nothing to stdout except protocol messages; log + to stderr. Over HTTP, bind to `127.0.0.1`, validate the `Origin` header, + and require a token. +- **Use the official SDK** and read the specification revision it targets. + The 2026-07-28 revision changed sessions and transports, so examples + written for older revisions may no longer apply. +- **Expose specific tools** (create a composition, add a layer, set a + property, queue a render, describe the project) rather than one tool that + runs any script. A run-anything tool is arbitrary code execution inside an + application allowed to write files and reach the network. If one exists, + keep it off by default and say so in its description. +- **Never build ExtendScript by pasting strings together.** Send arguments as + data, serialized once and parsed inside After Effects, or escape every + string with a single, tested function. +- **Run one command at a time.** All of it lands on After Effects' main + thread. Queue requests, time them out, and report "After Effects is busy" + when a render or a modal dialog holds it, rather than hanging. +- **Wrap each tool call in an undo group**, so the person at the keyboard can + undo what an agent did, and return structured results with the error + message and line when a script fails. + +Patterns, open-source examples and the security detail are in +[references/bridges-and-mcp.md](references/bridges-and-mcp.md). + +## Sources + +- CEP resources and cookbook: +- CEP retirement and UXP announcement: + +- After Effects UXP: +- After Effects C++ SDK Guide: +- Model Context Protocol: +- UPIA: diff --git a/skills/adobe-after-effects-integrations/references/bridges-and-mcp.md b/skills/adobe-after-effects-integrations/references/bridges-and-mcp.md new file mode 100644 index 0000000000..3480988521 --- /dev/null +++ b/skills/adobe-after-effects-integrations/references/bridges-and-mcp.md @@ -0,0 +1,151 @@ +# Bridges and MCP Servers for After Effects + +How a process outside After Effects gets work done inside it, and how to put +an MCP server in front of that safely. The ExtendScript each bridge runs is +covered by the adobe-after-effects-scripting skill. + +## The four bridges + +### 1. Command line + +- Windows: `AfterFX.exe -r ` runs a script "in the existing instance"; + `-s ""` runs a string. +- macOS: AppleScript `DoScriptFile` or `DoScript`, which needs the calling + app to have Automation permission for After Effects. +- Nothing comes back on stdout. `app.exitCode` is returned on the command + line on Windows and as the `DoScript` result on macOS; anything richer goes + through a file. The SDK guide notes `AfterFX.com` as the way to get console + feedback on Windows. +- Third-party tools report that instances started with `-m` do not receive + `-r` scripts, and that a modal dialog blocks every script until it closes. + +Good for a pipeline step that runs a known script. Poor for a conversation of +many small calls, because each one starts a process. + +### 2. File mailbox + +A ScriptUI panel or a `Startup` script polls a folder: + +```jsx +/* Inside After Effects. ES3; JSON comes from json2.js. */ +var acmeMailbox = new Folder(Folder.temp.fsName + "/acme-ae-bridge"); +var acmeTaskId = app.scheduleTask("acmeCheckMailbox()", 1000, true); + +function acmeCheckMailbox() { + var command = new File(acmeMailbox.fsName + "/command.json"); + if (!command.exists) { return; } + command.encoding = "UTF-8"; + command.open("r"); + var text = command.read(); + command.close(); + command.remove(); /* consume it first, so a bad command cannot repeat */ + var reply; + try { + var request = JSON.parse(text); + reply = acmeRun(request); /* dispatch to a known command, inside an undo group */ + } catch (err) { + reply = { ok: false, error: err.toString(), line: err.line }; + } + acmeWriteAtomically(acmeMailbox.fsName + "/result.json", JSON.stringify(reply)); +} +``` + +`acmeRun` and `acmeWriteAtomically` are the bridge's own helpers: a lookup +from command name to function, and a write to a temporary file followed by a +rename. + +- Pure ExtendScript, no listening port. Needs **Allow Scripts To Write Files + And Access Network**. +- Write every file under a temporary name and rename it into place, on both + sides, so neither reads half a file. +- Consume the command file before parsing it, and answer a request that fails + to parse or run with an error reply. An exception that escapes the + scheduled task repeats on every poll and the client never hears back. +- Give each request an ID and echo it in the reply, so a slow reply is never + mistaken for the answer to a newer request. +- Latency is the polling interval; `app.cancelTask(acmeTaskId)` stops it. +- Dispatch only to known commands. A mailbox that evaluates whatever it is + handed lets any process able to write the folder run code in After + Effects. + +### 3. Server in a CEP panel + +Node.js in a CEP panel listens on loopback and answers each request with +`evalScript`: + +- Bind to `127.0.0.1`, never `0.0.0.0`. +- Require a long random token, generated per session and handed to the + client out of band. +- Refuse requests that carry an `Origin` or `Referer` header, so a web page in + a browser cannot reach the server through the user's machine. +- Serialize arguments as JSON and parse them in the host script. +- CEP is scheduled to be off by default in After Effects from December 2028 + and removed at the end of 2029, so plan a UXP or native successor. + +### 4. AEGP + +A C++ plugin runs a socket on its own thread, queues requests, and wakes the +main thread with `AEGP_CauseIdleRoutinesToBeCalled()`. Its idle hook runs each +request with `AEGP_ExecuteScript` and replies with the script's last-line +value. Fastest and needs no panel, at the cost of native builds per platform +and the main-thread-only rule. + +## An MCP server in front + +### Protocol + +- Servers expose **tools** (model-controlled), **resources** + (application-controlled) and **prompts** (user-controlled). +- Transports are **stdio** and **Streamable HTTP**. A stdio server writes + nothing to stdout except valid MCP messages; logs go to stderr. +- The specification's current revision is **2026-07-28**. It changed sessions + and the HTTP transport, so examples written for 2025-11-25 and earlier may + be legacy. Let the SDK handle the protocol, and check which revision it + implements. +- SDKs: TypeScript (v2 packages `@modelcontextprotocol/server` and + `@modelcontextprotocol/client`; v1's `@modelcontextprotocol/sdk` receives + fixes for at least six months after v2's July 2026 release) and Python + (`mcp` on PyPI). + +### Security + +From the specification and its security best practices: + +- Prefer **stdio** for a local server: only the client that started it can + talk to it. +- Over HTTP, "Servers MUST validate the Origin header on all incoming + connections to prevent DNS rebinding attacks", should bind only to + `127.0.0.1`, and should authenticate every connection, with a token or a + local IPC channel. + +For After Effects in particular: + +- **Specific tools over a run-anything tool.** `create_composition`, + `add_layer`, `set_property`, `queue_render` and `describe_project` each + check their arguments. A tool that runs arbitrary ExtendScript is code + execution in an application that may be allowed to write files and reach + the network; if it exists, keep it off unless the user turns it on, and say + so in its description. +- **No string building.** Send arguments as data, parse them inside After + Effects, and never splice model output into a script. +- **One request at a time.** All work lands on After Effects' main thread. + Queue, time out, and return "After Effects is busy" when a render or a + dialog holds it. +- **Undo groups per tool call**, named after the tool, so a person can undo + an agent's change. +- **Structured errors.** Return the ExtendScript error message and line, not + just "failed". +- **Paths:** resolve any path a tool receives against an allowed folder, and + refuse anything outside it. + +## Open-source servers, for reference + +These are what their READMEs described as of November 2026. Read the current +code before reusing any of it. + +| Project | How it reaches After Effects | +| --- | --- | +| `Dakkshin/after-effects-mcp` | Installs a ScriptUI panel (`Window > mcp-bridge-auto.jsx`) that polls a command file with `app.scheduleTask` and writes a result file: the file mailbox. | +| `solomondivyananth/aftereffects-mcp` | stdio to a Node.js server, HTTP on a loopback port to a CEP panel, then `evalScript`. Loopback only, a 256-bit token, and requests with an `Origin` or `Referer` refused. | +| `JUNKDOGE-JOE/after-effects-mcp` | The MCP server runs in the CEP panel's Node.js host on a loopback HTTP port, with a stdio connector for clients. | +| `kumoproductions/mcp-aftereffects` | No panel by default: runs scripts with `-r` launches (Automation permission on macOS), with an optional `Startup` script that polls a mailbox in the temp folder. | diff --git a/skills/adobe-after-effects-integrations/references/cep.md b/skills/adobe-after-effects-integrations/references/cep.md new file mode 100644 index 0000000000..072aae8111 --- /dev/null +++ b/skills/adobe-after-effects-integrations/references/cep.md @@ -0,0 +1,202 @@ +# CEP Extensions for After Effects + +From Adobe's CEP 12 HTML Extension Cookbook and the CEP-Resources repository +(). Use the `CEP_12.x` folder for +After Effects 25.x and 26.x. + +## Versions + +| After Effects | CEP | +| --- | --- | +| 16 and 17 | 9 | +| 17.1.4 | 10 | +| 18.4 | 11 | +| 25.0 | 12 | +| 26.0 | 12 (`CEPHtmlEngine.exe` 12.0.1 in the installation; no Adobe table lists it) | + +CEP 12 bundles Node.js 17.7.1, Chromium 99 and Node-WebKit 0.62.1. The CSXS +key number in the debug settings below follows the CEP major version. + +## Layout + +```text +com.acme.demo-panel/ + ├ CSXS/ + │ └ manifest.xml + ├ index.html + ├ js/ + │ ├ CSInterface.js copied from CEP-Resources for the CEP version + │ └ main.js + ├ jsx/ + │ └ host.jsx ExtendScript the panel calls + └ .debug development only +``` + +The manifest declares the extension bundle and ID, the host (`AEFT` with a +version range), the CSXS version it requires, the main path, the script path, +the panel's geometry, and any `` parameters. This minimal +manifest loaded in After Effects 26.0: the panel opened from Window > +Extensions > Acme Demo, and an `evalScript` round trip returned. Take anything +more, such as `` or a minimum size, from the cookbook's sample. + +```xml + + + + + + + + + + + + + + + + + + + + + ./index.html + ./jsx/host.jsx + + + true + + + Panel + Acme Demo + + 300320 + + + + + + +``` + +- `Version="[25.0,99.9]"` covers 25.x and later; the brackets are inclusive. +- `` is the entry under Window > Extensions. A script can open the panel, + for example in a test: `app.executeCommand(app.findMenuCommandId("Acme Demo"))` + worked in 26.0. + +## Calling After Effects + +```js +var csInterface = new CSInterface(); +csInterface.evalScript("acmeDescribeProject()", function (result) { + if (result === "EvalScript error.") { + showError("After Effects could not run the script."); + return; + } + var data = JSON.parse(result); /* the panel side has JSON; ExtendScript does not */ + render(data); +}); +``` + +- `evalScript(script, callback)` runs in After Effects' ExtendScript engine + on its main thread. The callback is optional and receives a string; a + failure arrives as `"EvalScript error."`. +- The host script returns a string. Build JSON there with `json2.js`, since + ExtendScript has no native `JSON`. +- Pass arguments as data. Serialize them in the panel and parse them in the + host script; never paste user text into the script string. + +## Node.js in the panel + +```xml + + ./index.html + ./jsx/host.jsx + + --enable-nodejs + --mixed-context + + +``` + +`--enable-nodejs` has been supported since CEP 6.1 and `--mixed-context` since +CEP 7.0. `--remote-debugging-port` in `` is filtered out; use +a `.debug` file instead. + +## Install folders + +| Scope | Windows | macOS | +| --- | --- | --- | +| Per user | `C:\Users\\AppData\Roaming\Adobe\CEP\extensions` | `~/Library/Application Support/Adobe/CEP/extensions` | +| All users | `C:\Program Files (x86)\Common Files\Adobe\CEP\extensions` and, since CEP 6.1, `C:\Program Files\Common Files\Adobe\CEP\extensions` | `/Library/Application Support/Adobe/CEP/extensions` | + +CEP looks in the application's own folder, then the all-users folder, then +the per-user folder. With two copies of one bundle ID, the higher version +wins. A `#` anywhere in the path stops an extension from loading. + +## Development settings + +Unsigned extensions load only in debug mode, set per CEP version: + +```bat +reg add "HKCU\Software\Adobe\CSXS.12" /v PlayerDebugMode /t REG_SZ /d 1 /f +``` + +```bash +defaults write com.adobe.CSXS.12 PlayerDebugMode 1 +killall cfprefsd # macOS caches the plist until this, or a log out +``` + +A `.debug` file in the extension root opens Chrome DevTools on a port between +1024 and 65534: + +```xml + + + + + + + + +``` + +The `Extension Id` is the extension's ID from the manifest, not the bundle ID. +Then open `http://localhost:8088/` in Chrome. The cookbook's sample `.debug` +has no `AEFT` entry; add it. + +## Signing and installing + +```bat +ZXPSignCmd -selfSignedCert US CA "Acme Corp" "Acme Corp" acme-cert.p12 +ZXPSignCmd -sign com.acme.demo-panel com.acme.demo-panel.zxp acme-cert.p12 -tsa +ZXPSignCmd -verify com.acme.demo-panel.zxp -certinfo +``` + +- Always timestamp, and sign on the platform the extension will run on. +- A symlink inside the extension breaks the signature check after + installation. +- Install with the Unified Plugin Installer Agent, which ships with the + Creative Cloud desktop app: + - Windows: `"C:\Program Files\Common Files\Adobe\Adobe Desktop Common\RemoteComponents\UPI\UnifiedPluginInstallerAgent\UnifiedPluginInstallerAgent.exe" /install com.acme.demo-panel.zxp` + - macOS: `"/Library/Application Support/Adobe/Adobe Desktop Common/RemoteComponents/UPI/UnifiedPluginInstallerAgent/UnifiedPluginInstallerAgent.app/Contents/MacOS/UnifiedPluginInstallerAgent" --install com.acme.demo-panel.zxp` +- `ExManCmd` is not supported by Creative Cloud 2022 apps and later, even + though older guides still show it. +- aescripts' ZXP Installer is a front end that uses UPIA. + +## After Effects specifics + +- Panel size cannot be changed from code in After Effects. +- `evalScript` blocks After Effects while the script runs. Break long work + into steps, or move it to a render queue. +- The panel shares After Effects' ExtendScript global namespace with every + other script; prefix the host script's globals. +- Keep the host script inside the extension folder: name it in ``, + or `$.evalFile` a path below the extension folder. A path that climbs out with + `..` from `getSystemPath('extension')` is collapsed before a junction is + followed, so a development install linked into the CEP extensions folder + looks for the file there. In 26.0 the panel's `evalScript` call then came + back as an empty string, not `EvalScript error.` diff --git a/skills/adobe-after-effects-integrations/references/cpp-sdk.md b/skills/adobe-after-effects-integrations/references/cpp-sdk.md new file mode 100644 index 0000000000..4576cc0894 --- /dev/null +++ b/skills/adobe-after-effects-integrations/references/cpp-sdk.md @@ -0,0 +1,155 @@ +# The After Effects C++ SDK + +From the After Effects SDK Guide (). The +guide still links the SDK at adobe.io; the current download is on the Adobe +Developer Console, linked from . + +## Releases + +| SDK | Date | Note | +| --- | --- | --- | +| 25.2 | February 2025 | | +| 25.6 | September 2025 | Windows on Arm | +| 26.5 | September 2026 | | +| 27.0 update | October 2026 | For the After Effects beta only | + +## Plugin types + +| Type | For | +| --- | --- | +| Effect | Processing pixels (and audio) as an effect in the Effects menu | +| AEGP (After Effects General Plugin) | Menu commands, hooks, idle-time work, scripting from native code | +| AEIO | Importing and exporting file formats | +| Artisan | 3D rendering | +| BlitHook | Output to external hardware | + +## Entry points + +Effect, as the guide gives it; the name can be anything the PiPL declares, and +the samples use `EffectMain`: + +```cpp +PF_Err EffectMain( + PF_Cmd cmd, + PF_InData *in_data, + PF_OutData *out_data, + PF_ParamDef *params[], + PF_LayerDef *output, + void *extra); +``` + +It switches on `cmd`: `PF_Cmd_ABOUT`, `PF_Cmd_GLOBAL_SETUP`, +`PF_Cmd_PARAMS_SETUP`, `PF_Cmd_RENDER`, and the SmartFX and GPU selectors +below. + +AEGP, declared in the PiPL and named `EntryPointFunc` in the samples: + +```cpp +A_Err EntryPointFunc( + struct SPBasicSuite *pica_basicP, + A_long major_versionL, + A_long minor_versionL, + AEGP_PluginID aegp_plugin_id, + AEGP_GlobalRefcon *global_refconP); +``` + +## PiPL resources + +- Every plugin carries a PiPL describing it. The out flags in the PiPL + (`AE_Effect_Global_OutFlags`) must match the ones `PF_Cmd_GLOBAL_SETUP` + sets. +- Windows: the sample projects' custom build steps process the + cross-platform `.r` file into an `.rc` file. The guide names both + `pipltool.exe` and `cnvtpipl.exe` for this; follow the sample's build step. +- macOS: Rez compiles the `.r` file. + +## Files and install locations + +- Windows: a DLL with the `.aex` extension. macOS: a `.plugin` bundle. +- Installers: + - Windows: read `HKLM\SOFTWARE\Adobe\After Effects\\CommonPluginInstallPath` + for the shared folder, or `PluginInstallPath` for After Effects only. + - macOS: `/Library/Application Support/Adobe/Common/Plug-ins/7.0/MediaCore/` + (7.0 for every Creative Cloud version), or + `/Applications/Adobe After Effects /Plug-ins/` for After Effects + only. +- Development: `C:\Program Files\Adobe\Common\Plug-ins\7.0\MediaCore\` on + Windows, which the guide recommends for development only, and + `~/Library/Application Support/Adobe/Common/Plug-ins/7.0/MediaCore/` on + macOS. +- After Effects scans 10 folder levels deep and skips folders whose names end + in a closing parenthesis or start with `~` (Windows) or `¬` (macOS). +- macOS 15 and later refuse unsigned plugins. For local development an ad hoc + signature works: `codesign --force --deep --sign - `. +- Native ARM builds of After Effects, on Windows on Arm and Apple Silicon, + load only plugins compiled natively for ARM. + +## Multi-Frame Rendering + +`PF_OutFlag2_SUPPORTS_THREADED_RENDERING`: "Effects must be thread-safe before +this flag is set." Thread-safe means: + +- no static or global state that two renders could race on; +- no writes to `in_data->global_data` or to sequence data at render time; + read sequence data through `PF_EffectSequenceDataSuite1`, and use + `PF_OutFlag2_MUTABLE_RENDER_SEQUENCE_DATA_SLOWER` or the Compute Cache when + render-time state is unavoidable; +- no mutex held while calling back into the host. + +Sequence setup, resetup and setdown, smart pre-render, render and smart +render can all arrive on several threads at once. The guide warns that +effects compiled with the June 2020 SDK do not get Multi-Frame Rendering, and +that an effect setting `PF_OutFlag2_SEQUENCE_DATA_NEEDS_FLATTENING` must also +set `PF_OutFlag2_SUPPORTS_GET_FLATTENED_SEQUENCE_DATA`. + +## SmartFX and GPU + +- `PF_OutFlag2_SUPPORTS_SMART_RENDER` brings `PF_Cmd_SMART_PRE_RENDER` and + `PF_Cmd_SMART_RENDER`, where the effect asks for only the input region it + needs. +- GPU: `PF_Cmd_GPU_DEVICE_SETUP` sets one or both of the + `PF_OutFlag2_SUPPORTS_GPU_RENDER_Fxx` flags (the guide documents + `PF_OutFlag2_SUPPORTS_GPU_RENDER_F32`, new in 16.0); rendering arrives as + `PF_Cmd_SMART_RENDER_GPU`, and `PF_Cmd_GPU_DEVICE_SETDOWN` releases the + device. DirectX rendering also needs + `PF_OutFlag2_SUPPORTS_DIRECTX_RENDERING`. + +## AEGP suites a bridge uses + +```cpp +/* AEGP_UtilitySuite6 */ +A_Err AEGP_ExecuteScript( + AEGP_PluginID inPlugin_id, + const A_char *inScriptZ, + const A_Boolean platform_encodingB, + AEGP_MemHandle *outResultPH0, + AEGP_MemHandle *outErrStringPH0); + +/* AEGP_RegisterSuite5 */ +A_Err AEGP_RegisterIdleHook( + AEGP_PluginID aegp_plugin_id, + AEGP_IdleHook idle_hook_func, + AEGP_IdleRefcon refconP); +``` + +- The script may be UTF-8, or the application encoding when + `platform_encodingB` is true. The value of the script's last line comes back + in `outResultPH0`; both out handles are optional, and the plugin frees them. +- "AEGP supports no threading at all." Everything happens on the main thread, + in a callback or the idle hook, which After Effects calls "sporadically". + The one call safe from another thread is + `AEGP_CauseIdleRoutinesToBeCalled()`, so a socket thread queues the work and + calls it to wake the idle hook. + +## Build tools + +The guide's only explicit statement (Visual Studio 2019, Xcode 11 and 12) is +out of date. Requirements stated elsewhere in it: + +- Universal macOS binaries need Xcode 12.2 or later. +- Windows on Arm builds need Visual Studio 17.4 or later. +- The GPU sample needs Boost, CUDA and DXC; the 27.0 sample uses CUDA 12.8 on + x64 and CUDA 13.4 on ARM64. + +Open the sample projects from the SDK release you build against, and match +their toolchain. diff --git a/skills/adobe-after-effects-scripting/SKILL.md b/skills/adobe-after-effects-scripting/SKILL.md new file mode 100644 index 0000000000..3a9e1842bb --- /dev/null +++ b/skills/adobe-after-effects-scripting/SKILL.md @@ -0,0 +1,441 @@ +--- +name: adobe-after-effects-scripting +description: 'Automate Adobe After Effects and write, edit, debug or review its scripts and expressions. Covers ExtendScript (.jsx, .jsxbin) and its ECMAScript 3 limits, the object model (app, project, items, folders, compositions, layers, properties, keyframes, effects, text), undo groups, the render queue and the hand-off to Adobe Media Encoder, ScriptUI panels, the Scripts, ScriptUI Panels, Startup and Shutdown folders, running a script from outside with AfterFX.exe -r and -s or AppleScript DoScriptFile, rendering with aerender, and expressions on both expression engines. Use for any code that After Effects itself runs. For CEP or UXP panels, C++ SDK plugins, or an MCP server or other bridge that drives After Effects from another process, use adobe-after-effects-integrations instead; the ExtendScript such a component sends into After Effects is still this skill.' +--- + +# Adobe After Effects Scripting + +Write the scripts After Effects runs, and the expressions it evaluates, so they +work the first time on the version that is installed. + +## Scope + +| This skill | adobe-after-effects-integrations | +| --- | --- | +| ExtendScript `.jsx` and `.jsxbin` that After Effects runs | CEP and UXP panels, and how they call into After Effects | +| The object model: project, items, layers, properties, render queue | C++ effect, AEGP and AEIO plugins built on the SDK | +| ScriptUI panels in the `ScriptUI Panels` folder | MCP servers and other bridges that drive After Effects from another process | +| `AfterFX.exe -r` and `-s`, AppleScript `DoScriptFile`, `aerender` | Packaging, signing and installing extensions and plugins | +| Expressions, and scripts that write them | | + +An MCP server's tools belong to the integrations skill. The ExtendScript those +tools send into After Effects belongs here. + +## Before writing a script + +1. **Know the version.** `app.version` is a string, so compare it with + `parseFloat(app.version)`. Since After Effects 2022 the major version + matches the year: 2026 is 26.x. Every attribute in the scripting guide + lists the version that added it; check before using anything recent. +2. **Know how it will run.** By hand from `File > Scripts > Run Script File`, + as a docked panel, at startup, or unattended from the command line. An + unattended script must never open a dialog: a modal dialog blocks every + script after it. +3. **Know what it touches.** Writing files, reading them outside the project, + or using `Socket` needs the preference **Allow Scripts To Write Files And + Access Network** (see [Running scripts](#running-scripts)). +4. **Write ES3**, or compile down to it (see [The language](#the-language)). + +## The language + +ExtendScript implements ECMAScript 3 plus E4X. It is not the JavaScript engine +expressions use. + +- **Not available:** `let`, `const`, arrow functions, template literals, + classes, default parameters, destructuring, `Array.prototype.forEach`, + `map`, `filter` and `indexOf`, `Object.keys`, `String.prototype.trim`. + Write `var` and plain `for` loops. +- **No `JSON` object.** ExtendScript has never had one natively. A `JSON` you + happen to find was polyfilled by something else (the Libraries panel does + this) and can vanish. Bring `json2.js` with `#include` or `$.evalFile`, or + use `extendscript-es5-shim`. +- **One global namespace** is shared by every script for the whole session. + Wrap each script in a function, and give any global you mean to keep a + name nothing else will use. +- **Files** are UTF-8 `.jsx`. `#include "lib.jsxinc"` (or `//@include`) and + `#includepath` pull in other files; a missing include is a run-time error. + `$.evalFile(path[, timeout])` runs another file. `.jsxbin` is a compiled + form that "may not be usable with all of the scripting integration + features". +- `$.os` names the operating system; `system.osName` is blank on Windows. +- Use `generateRandomNumber()` rather than `Math.random()` for values a + script sets. + +## The object model + +```text +app + └ project always present; project.file is null until saved + ├ item(i), numItems 1-based: CompItem, FootageItem, FolderItem + ├ activeItem the item selected in the Project panel, or null + ├ rootFolder + └ renderQueue item(i) → RenderQueueItem → outputModule(i) +CompItem + ├ layer(i), numLayers 1-based; layer(1) is the top of the stack + └ width, height, duration, frameRate, frameDuration, workAreaStart, workAreaDuration +Layer, AVLayer, TextLayer, ... + └ property(matchName) PropertyGroup → ... → Property +``` + +- **Collections start at 1.** `RenderQueue.item` is documented as + `[0..numItems]`; treat it as 1-based like every other collection. Remove + items while counting down, not up. +- **`instanceof` matches only the most specific class.** A text layer is + `instanceof TextLayer` but not `instanceof AVLayer`. `item instanceof + CompItem` is the usual test before treating `activeItem` as a comp. +- **Reach properties by match name**, never by display name, which changes + with the language After Effects runs in: + `layer.property("ADBE Transform Group").property("ADBE Position")`. +- **Time is in seconds.** A frame is `frame * comp.frameDuration`. +- **Units:** Position and Anchor Point in pixels, `[x, y]` on a 2D layer and + `[x, y, z]` on a 3D one; Scale in percent per axis; Rotation in degrees; + Opacity 0 to 100; colours as `[r, g, b]` from 0 to 1. +- **`setValue` throws on a property that has keyframes.** Use + `setValueAtTime` or `setValuesAtTimes` there. +- **Adding to an indexed group invalidates references into it.** After + `addProperty` on `"ADBE Effect Parade"`, every effect or parameter you + already held is stale. Keep `propertyIndex` values and fetch again. + +Signatures, ranges and match names are in +[references/object-model.md](references/object-model.md). + +## Patterns + +All examples are ES3 and use placeholder names. + +### Undo group and errors + +```jsx +(function acmeBuildDemo() { + app.beginUndoGroup("Acme: Build Demo"); + try { + buildDemo(); + } catch (err) { + alert("Build Demo failed on line " + err.line + ": " + err.message); + } finally { + app.endUndoGroup(); + } +})(); +``` + +`endUndoGroup()` without a matching `beginUndoGroup()` is an error, so keep +the pair in `try` and `finally`. An unattended script logs instead of calling +`alert`. + +### Find or create + +```jsx +function findItem(name, type) { + for (var i = 1; i <= app.project.numItems; i++) { + var item = app.project.item(i); + if (item.name === name && (!type || item instanceof type)) { + return item; + } + } + return null; +} + +function findOrCreateFolder(name) { + return findItem(name, FolderItem) || app.project.items.addFolder(name); +} +``` + +### Build a composition from footage + +```jsx +function buildDemo() { + var file = new File("~/Desktop/sample-clip.mov"); + if (!file.exists) { + throw new Error("Footage not found: " + file.fsName); + } + var footage = app.project.importFile(new ImportOptions(file)); + footage.parentFolder = findOrCreateFolder("Source Footage"); + + /* name, width, height, pixel aspect, duration (s), frame rate */ + var comp = app.project.items.addComp("Demo Comp", 1080, 1080, 1, 10, 30); + var layer = comp.layers.add(footage); + centerLayer(comp, layer); + return comp; +} +``` + +### Center or align a layer + +```jsx +function centerAnchor(layer) { + var rect = layer.sourceRectAtTime(0, false); + layer.property("ADBE Transform Group").property("ADBE Anchor Point") + .setValue([rect.left + rect.width / 2, rect.top + rect.height / 2]); +} + +function centerLayer(comp, layer) { + centerAnchor(layer); + layer.property("ADBE Transform Group").property("ADBE Position") + .setValue([comp.width / 2, comp.height / 2]); +} + +/* Top-right corner, `margin` pixels in, at the layer's current scale. */ +function alignTopRight(comp, layer, margin) { + var transform = layer.property("ADBE Transform Group"); + var rect = layer.sourceRectAtTime(0, false); + var scale = transform.property("ADBE Scale").value; + var w = rect.width * scale[0] / 100; + var h = rect.height * scale[1] / 100; + centerAnchor(layer); + transform.property("ADBE Position") + .setValue([comp.width - margin - w / 2, margin + h / 2]); +} +``` + +Stacking order: `moveToBeginning()` (top), `moveToEnd()` (bottom), +`moveBefore(other)`, `moveAfter(other)`. + +### Fit footage to a length + +`stretch` is a percentage of the layer's duration, not its speed: 100 is +unchanged, 200 lasts twice as long and plays at half speed. + +```jsx +function fitToLength(comp, layer, seconds) { + var natural = layer.source.duration; + if (natural > seconds) { + layer.stretch = seconds / natural * 100; + } else { + comp.workAreaStart = layer.inPoint; + comp.workAreaDuration = natural; + } +} +``` + +### Keyframes and expressions + +```jsx +var transform = layer.property("ADBE Transform Group"); +transform.property("ADBE Opacity").setValuesAtTimes([0, 1], [0, 100]); + +var rotation = transform.property("ADBE Rotate Z"); +if (rotation.canSetExpression) { + rotation.expression = "time * 90"; + if (rotation.expressionError !== "") { + /* 26.0 does not throw for an invalid expression, and expressionEnabled + stays true; expressionError holds the message. */ + $.writeln("Expression rejected: " + rotation.expressionError); + } +} +``` + +### Effects + +```jsx +function effectMatchName(displayName) { + for (var i = 0; i < app.effects.length; i++) { + if (app.effects[i].displayName === displayName) { + return app.effects[i].matchName; + } + } + return null; +} + +var parade = layer.property("ADBE Effect Parade"); +var blur = parade.addProperty(effectMatchName("Gaussian Blur")); +blur.property(1).setValue(12); +``` + +`app.effects` is an ordinary 0-based array of `{ displayName, category, +matchName, version }`. Apply effects by `matchName`, which does not change +between versions or languages; the lookup by display name above is only for +finding it once. + +### Text + +```jsx +var text = comp.layers.addText("Hello, World"); +var sourceText = text.property("ADBE Text Properties").property("ADBE Text Document"); +var doc = sourceText.value; +doc.fontSize = 72; +sourceText.setValue(doc); +``` + +### Render + +```jsx +var rqItem = app.project.renderQueue.items.add(comp); +var om = rqItem.outputModule(1); +om.applyTemplate("High Quality"); /* must be one of om.templates */ +om = rqItem.outputModule(1); /* fetch again after any settings change */ +om.file = new File("~/Desktop/demo-comp.mov"); + +app.project.renderQueue.render(); /* blocks until the render finishes */ +``` + +- `om.templates` lists the output module templates this installation has; + names differ between versions and languages, so check before applying one. +- `RenderQueueItem.applyTemplate()` applies a **render settings** template; + `OutputModule.applyTemplate()` applies an **output module** template. +- The output module object can go stale after its settings change. Fetch it + again with `outputModule(i)` before the next use. +- The output folder must exist: `render()` throws "Directory does not exist" + otherwise, so create it first with `new Folder(path).create()`. +- Nothing about a render queue item can change while a render runs or is + paused. +- `layer.audioEnabled = false` silences one layer; whether a file gets an + audio track at all is the output module's setting. + +**Adobe Media Encoder** instead of the internal renderer: + +```jsx +if (app.project.renderQueue.canQueueInAME) { + app.project.renderQueue.queueInAME(false); /* true also starts the AME queue */ +} +``` + +Only items whose status is queued are sent. Media Encoder applies **its most +recently used encoding preset**, not the output module template, so set the +format in Media Encoder. Requires After Effects 14.0 and Media Encoder 11.0 or +later. + +### Save and close + +```jsx +app.project.save(new File("~/Desktop/demo-project.aep")); +app.project.close(CloseOptions.DO_NOT_SAVE_CHANGES); /* before app.newProject() */ +``` + +`app.newProject()` prompts to save a changed project unless it is closed +first. + +## Running scripts + +- **By hand:** `File > Scripts > Run Script File`. A script copied into the + Scripts folder appears under `File > Scripts` after After Effects restarts. +- **Folders.** Windows: `C:\Program Files\Adobe\Adobe After Effects \Support Files\Scripts\`. + macOS: `/Applications/Adobe After Effects /Scripts/`. Inside it: + - `ScriptUI Panels\`: scripts listed at the bottom of the Window menu, which + can dock. + - `Startup\` and `Shutdown\`: run in alphabetical order when After Effects + starts and quits. +- **File and network access:** **Allow Scripts To Write Files And Access + Network**. Windows: `Edit > Preferences > Scripting & Expressions`. macOS: + `After Effects > Settings > Scripting & Expressions`. It moved there from + General in 16.1. After Effects 26.0 regrouped the Preferences dialog, so + search for the label if the pane is not where you expect. +- **From outside After Effects:** `AfterFX.exe -r ` runs a script in + the instance that is already running, `-s ""` runs a string, and + macOS uses AppleScript `DoScriptFile` or `DoScript`. Scripts take no + arguments and print nothing to the caller. Pass values by setting globals + with `-s` and then `$.evalFile`, and hand results back in a file. Details + are in [references/command-line.md](references/command-line.md). +- **Unattended runs:** no `alert`, `confirm` or `prompt`. Bracket the work + with `app.beginSuppressDialogs()` and `app.endSuppressDialogs(false)` to + hold back script error dialogs, and write a log into `Folder.temp`. +- **Rendering without the user interface:** `aerender`, also in + [references/command-line.md](references/command-line.md). + +## ScriptUI panels + +The guide's dockable panel pattern, which works both from the ScriptUI Panels +folder and from `Run Script File`: + +```jsx +(function acmeToolsPanel(thisObj) { + function buildUI(host) { + var panel = (host instanceof Panel) + ? host + : new Window("palette", "Acme Tools", undefined, { resizeable: true }); + var button = panel.add("button", undefined, "Center Selected Layers"); + button.onClick = function () { + var comp = app.project.activeItem; + if (!(comp instanceof CompItem)) { return; } + app.beginUndoGroup("Acme: Center Layers"); + try { + for (var i = 0; i < comp.selectedLayers.length; i++) { + centerLayer(comp, comp.selectedLayers[i]); + } + } finally { + app.endUndoGroup(); + } + }; + panel.layout.layout(true); + return panel; + } + + var ui = buildUI(thisObj); + if (ui instanceof Window) { + ui.center(); + ui.show(); + } +})(this); +``` + +Pass `this` in from the top level: inside a function, `this` is not the panel. +`centerLayer` is the helper from [Center or align a layer](#center-or-align-a-layer). + +## Expressions + +- **Two engines, chosen per project** in `File > Project Settings > + Expressions`: the **JavaScript** engine (ECMAScript 2018 based, added in + 16.0) and **Legacy ExtendScript** (ECMAScript 3). Projects saved before + 16.0 open on Legacy. A script reads or sets it with + `app.project.expressionEngine`, `"javascript-1.0"` or `"extendscript"`. +- The engine setting affects expressions only. Scripts always run in + ExtendScript. +- **Common vocabulary:** `time`, `value`, `thisComp`, `thisLayer`, + `comp("Name")`, `effect("Slider Control")("Slider")`, `wiggle(freq, amp)`, + `loopOut("cycle")`, `linear(t, tMin, tMax, value1, value2)`, `ease(...)`, + `valueAtTime(t)`, `posterizeTime(framesPerSecond)`. +- Some newer methods exist only on the JavaScript engine. Check the + expression reference's changelog before relying on one. +- Expressions run for every frame they are sampled at. Keep them cheap, and + bake them to keyframes (`Animation > Keyframe Assistant > Convert + Expression to Keyframes`) when a project gets slow. +- From a script, check `canSetExpression` first, and read `expressionError` + after assigning: `""` for a valid expression, the message for an invalid + one. In 26.0 an invalid expression does not throw on either engine, and + `expressionEnabled` stays true. + +## Debugging and tooling + +- **Debugger:** Visual Studio Code with Adobe's **ExtendScript Debugger** + extension is the supported way. ExtendScript Toolkit is deprecated and does + not run on current macOS. In After Effects, breakpoints inside callbacks + need `$.level = 1` set in the script. +- **Output:** `$.writeln()` writes to the debugger's console, `writeLn()` + writes to After Effects' Info panel, and `alert()` opens a modal dialog. +- **Types:** the npm package `types-for-adobe` has After Effects typings per + version, used with `/// ` + and a `tsconfig.json` with `"module": "none"` and `"noLib": true`. +- **Shims:** `extendscript-es5-shim` adds ES5 `Array`, `String`, `Function`, + `Object`, `Date` and `JSON` methods. Its `Object` descriptor functions are + only mocks. + +## Pitfalls + +- [ ] Loops run from 1 to `numItems` or `numLayers`, and count down when + removing. +- [ ] `app.project.activeItem` can be null or something other than a comp. +- [ ] Properties are reached by match name. +- [ ] Every reference into an effect group is fetched again after + `addProperty`. +- [ ] The output module is fetched again after `applyTemplate` or + `setSettings`. +- [ ] Keyframed properties use `setValueAtTime`. +- [ ] After setting an expression, `expressionError` is checked; an invalid + one does not throw. +- [ ] `app.findMenuCommandId` depends on the user interface language, so + prefer a known command ID. +- [ ] Windows paths in `File` use forward slashes, or `File.fsName` when + handing a path to the operating system. +- [ ] Inside an `-s` string, the script's own strings use single quotes. +- [ ] `LayerCollection.add` places a layer at the composition start or the + current time, according to the **Create Layers at Composition Start + Time** preference, and a still image's length follows the Import + preferences. + +## Sources + +- After Effects Scripting Guide: +- After Effects Expression Reference: +- JavaScript Tools Guide (File, Folder, `$`, ScriptUI): +- Adobe Media Encoder Scripting Guide: +- Adobe Help Center, automated rendering and network rendering (`aerender`): + diff --git a/skills/adobe-after-effects-scripting/references/command-line.md b/skills/adobe-after-effects-scripting/references/command-line.md new file mode 100644 index 0000000000..1bb5a86c60 --- /dev/null +++ b/skills/adobe-after-effects-scripting/references/command-line.md @@ -0,0 +1,108 @@ +# Running After Effects from the Command Line + +## Run a script in the running instance + +Windows: + +```bat +"C:\Program Files\Adobe\Adobe After Effects \Support Files\AfterFX.exe" -r "C:\Users\\Documents\acme\build-demo.jsx" +"C:\Program Files\Adobe\Adobe After Effects \Support Files\AfterFX.exe" -s "writeLn('Hello, World');" +``` + +- `-r ` runs a script file. It "does not open a new instance of the + After Effects application; it runs the script in the existing instance". +- `-s ""` runs a string. Use single quotes for strings inside it; the + guide's own example nests double quotes and is wrong. +- `writeLn` prints to the Info panel. `alert` opens a modal dialog, which + blocks every later script, so keep it to interactive checks. +- If After Effects exits at once with `-r`, try the path without quotes, as + the guide suggests. +- Instances started with `-m` are reported not to receive `-r` scripts. That + report comes from third-party tools, not from Adobe. +- `-noui` is not documented by Adobe. Do not rely on it. + +macOS, through AppleScript: + +```bash +osascript -e 'tell application "Adobe After Effects " to DoScriptFile "/Users//Documents/acme/build-demo.jsx"' +osascript -e 'tell application "Adobe After Effects " to DoScript "writeLn(\"Hello, World\");"' +``` + +The guide's AppleScript examples name "Adobe After Effects CS6"; use the name +of the installed application. + +## Pass values in, get results out + +A script takes no command-line arguments and writes nothing to the caller's +standard output. + +- **In:** all scripts share one global namespace for the session, so set a + global in a `-s` string and then run the file from the same string: + + ```bat + AfterFX.exe -s "var acmeJob = { compName: 'Demo Comp', length: 10 }; $.evalFile('C:/Users//Documents/acme/build-demo.jsx');" + ``` + + The script reads `acmeJob`, and should check `typeof acmeJob` first. +- **Out:** write a result file the caller reads, for example JSON built with + `json2.js` into `Folder.temp`. Write it under a temporary name and rename it + when done, so the caller never reads half a file. File writes need **Allow + Scripts To Write Files And Access Network**. +- **Status:** `app.exitCode` is returned on the command line on Windows, and + as the `DoScript` result on macOS. The SDK guide notes that on Windows + `AfterFX.com` is the way to get feedback to the console. +- **Dialogs:** a modal dialog blocks every later script, so an unattended run + never opens one. + +## Render with aerender + +`aerender` sits beside `AfterFX.exe` in `Support Files` on Windows, and in the +application folder on macOS. `aerender -help` prints the flags for the +installed version. These are the flags version 26.0 prints: + +| Flag | Meaning | +| --- | --- | +| `-project ` | Project file or URI to open. Without it, the open project is used. | +| `-teamproject ` | A team project to open. | +| `-comp ` | Render this comp: its first queueable render queue item, or a new one. Without `-comp`, the whole render queue renders as is, and only `-project`, `-log`, `-v`, `-mem_usage` and `-close` apply. | +| `-rqindex ` | Render this render queue item. | +| `-RStemplate ` | Render settings template to apply. An unknown name is an error. | +| `-renderSettings ""` | Override individual render settings, for example `"Resolution: Half; Quality: Draft"`. | +| `-OMtemplate ` | Output module template to apply. An unknown name is an error. | +| `-outputSettings ""` | Override individual output module settings, for example `"Crop: true; Crop Top: 4"`. | +| `-output ` | Destination file or URI. Frame sequences use `[####]`. | +| `-log ` | Log file. Defaults to standard output. | +| `-s `, `-e ` | First and last frame; the end frame is inclusive. | +| `-i ` | Render every Nth frame, repeating each. Defaults to 1. | +| `-mem_usage ` | Memory limits. | +| `-mfr ` | Multi-Frame Rendering and a CPU cap. | +| `-v ` | Messages to report. Defaults to `ERRORS_AND_PROGRESS`. | +| `-close ` | What to do with the project afterwards. Defaults to `DO_NOT_SAVE_CHANGES`. | +| `-sound ` | Play a sound when done. | +| `-reuse` | Ask an already running After Effects to render. Without it, `aerender` always starts a new instance and quits it when done. | +| `-continueOnMissingFootage` | Render missing footage as colour bars instead of stopping. | +| `-version` | Print the version and exit. | + +Examples, with placeholder paths: + +```bat +aerender -project "C:\Users\\Documents\acme\demo-project.aep" -comp "Demo Comp" -output "C:\Users\\Documents\acme\out\demo-comp.mov" +aerender -project "C:\Users\\Documents\acme\demo-project.aep" -comp "Demo Comp" -RStemplate "Best Settings" -OMtemplate "High Quality" -output "C:\Users\\Documents\acme\out\demo-comp.mov" +``` + +Template names must exist in the installation. List them from a script with +`OutputModule.templates`. + +## Adobe Media Encoder + +From After Effects, `app.project.renderQueue.queueInAME(false)` sends queued +items to Media Encoder, which applies its most recently used preset. + +Media Encoder has its own scripting API (). +Its top-level `app` offers `getFrontend()`, `getEncoderHost()`, +`getExporter()` and `getWatchFolder()`, and a script runs from the command +line with: + +```text + --console es.processFile +``` diff --git a/skills/adobe-after-effects-scripting/references/object-model.md b/skills/adobe-after-effects-scripting/references/object-model.md new file mode 100644 index 0000000000..af7d986336 --- /dev/null +++ b/skills/adobe-after-effects-scripting/references/object-model.md @@ -0,0 +1,147 @@ +# After Effects Object Model Reference + +Signatures as the After Effects Scripting Guide gives them +(). Square brackets mark optional +arguments. Check the guide for the version that added anything not listed +here. + +## Application (`app`) + +| Member | Notes | +| --- | --- | +| `app.project` | The open project. Always present; `app.project.file` is `null` until it is saved. | +| `app.version` | String. Compare with `parseFloat`. | +| `app.newProject()` | Returns a `Project`, or `null`. Prompts to save a changed project, so close it first. | +| `app.open([file])` | Returns a `Project`, or `null` when cancelled. | +| `app.beginUndoGroup(undoString)` / `app.endUndoGroup()` | `endUndoGroup` without a begin is an error. | +| `app.beginSuppressDialogs()` / `app.endSuppressDialogs(alert)` | Holds back script error dialogs. | +| `app.scheduleTask(stringToExecute, delay, repeat)` | `delay` in milliseconds. Returns an integer ID for `app.cancelTask(taskID)`. | +| `app.executeCommand(id)` / `app.findMenuCommandId(name)` | `findMenuCommandId` is not reliable across language versions. | +| `app.purge(target)` | Replicates `Edit > Purge`, for example `PurgeTarget.ALL_CACHES`. | +| `app.effects` | 0-based array of `{ displayName, category, matchName, version }`. | +| `app.exitCode` | Returned on the command line on Windows, and as the `DoScript` result on macOS. | +| `app.exitAfterLaunchAndEval` | Windows command-line runs only. | +| `app.isRenderEngine` | True when After Effects runs as a render engine. | +| `app.quit()` | Quits After Effects. | +| `system.callSystem(cmd)` | Runs a command and returns its output. On Windows wrap it as `cmd.exe /c "..."`. | + +## Project (`app.project`) + +| Member | Notes | +| --- | --- | +| `item(index)`, `numItems` | 1-based. | +| `itemByID(id)` | From 13.0. | +| `activeItem` | The item selected in the Project panel, or `null`. | +| `rootFolder` | The top `FolderItem`. | +| `importFile(importOptions)` | Returns a `FootageItem`. `new ImportOptions()` or `new ImportOptions(file)`. | +| `save([file])` | | +| `close(closeOptions)` | `CloseOptions.DO_NOT_SAVE_CHANGES`, `PROMPT_TO_SAVE_CHANGES` or `SAVE_CHANGES`. | +| `renderQueue` | See [Render queue](#render-queue). | +| `expressionEngine` | `"javascript-1.0"` or `"extendscript"`. From 16.0. | + +## ItemCollection (`app.project.items`) + +| Member | Notes | +| --- | --- | +| `addComp(name, width, height, pixelAspect, duration, frameRate)` | Width and height 4 to 30000; pixel aspect 0.01 to 100.0; duration 0.0 to 10800.0 seconds; frame rate 1.0 to 99.0. Returns a `CompItem`. | +| `addFolder(name)` | Returns a `FolderItem`. | + +Every item has `name`, `id` and a read/write `parentFolder`. + +## CompItem + +| Member | Notes | +| --- | --- | +| `layer(index)`, `numLayers` | 1-based; `layer(1)` is the top. | +| `layers` | The `LayerCollection`. | +| `selectedLayers` | 0-based JavaScript array. | +| `width`, `height`, `duration`, `frameRate`, `frameDuration` | Duration in seconds. | +| `workAreaStart`, `workAreaDuration` | Seconds, read/write. | +| `time` | The current time indicator, in seconds. | + +## LayerCollection (`comp.layers`) + +| Member | Notes | +| --- | --- | +| `add(item[, duration])` | Placement follows the **Create Layers at Composition Start Time** preference. | +| `addSolid(color, name, width, height, pixelAspect[, duration])` | `color` is `[r, g, b]`, each 0.0 to 1.0. | +| `addText([sourceText])` | A string or a `TextDocument`. Returns a `TextLayer`. | +| `byName(name)` | The first (topmost) layer with that name. | + +## Layer and AVLayer + +| Member | Notes | +| --- | --- | +| `moveToBeginning()`, `moveToEnd()`, `moveBefore(layer)`, `moveAfter(layer)` | Top, bottom, or next to another layer. | +| `stretch` | Percent of duration, -9900.0 to 9900.0. 100 is unchanged and 200 lasts twice as long. Values between 0 and 1 become 1, and values between -1 and 0 become -1. | +| `inPoint`, `outPoint`, `startTime` | Seconds. | +| `source` | The item an AVLayer shows; `source.duration` for footage. | +| `sourceRectAtTime(timeT, extents)` | Returns `{ top, left, width, height }`. | +| `audioEnabled` | Read/write; the Timeline audio switch. | +| `hasAudio`, `audioActive` | Read-only. | +| `property(nameOrMatchName)` | See below. | + +`instanceof` matches only the most specific class: `TextLayer`, `ShapeLayer`, +`CameraLayer`, `LightLayer` or `AVLayer`. + +## Property and PropertyGroup + +| Member | Notes | +| --- | --- | +| `value` | The value at the current time. | +| `setValue(newValue)` | Throws when the property has keyframes. | +| `setValueAtTime(time, newValue)` | Adds or replaces a keyframe. | +| `setValuesAtTimes(times, newValues)` | Arrays of the same length. | +| `numKeys`, `keyValue(keyIndex)` | `keyValue` also takes a marker comment for marker properties. | +| `canSetExpression`, `expression`, `expressionEnabled`, `expressionError` | Assigning an invalid expression does not throw (checked in 26.0, on both engines), and `expressionEnabled` stays true; read `expressionError`, which is `""` when there is none. | +| `propertyIndex` | Use it to fetch a property again after its group changed. | +| `PropertyGroup.addProperty(nameOrMatchName)` | Invalidates existing references into that group. | + +### Match names + +| Match name | Display name | +| --- | --- | +| `ADBE Transform Group` | Transform | +| `ADBE Anchor Point` | Anchor Point | +| `ADBE Position` | Position | +| `ADBE Scale` | Scale | +| `ADBE Rotate Z` | Rotation | +| `ADBE Opacity` | Opacity | +| `ADBE Effect Parade` | Effects | +| `ADBE Text Properties` | Text | +| `ADBE Text Document` | Source Text | + +Effect match names come from `app.effects`. + +## Render queue + +| Member | Notes | +| --- | --- | +| `app.project.renderQueue.items.add(comp)` | Returns a `RenderQueueItem`. | +| `RenderQueue.render()` | Returns only when rendering is complete. | +| `RenderQueue.queueInAME(render_immediately_in_AME)` | `false` only queues in Media Encoder; `true` also starts its queue. From 14.0; needs Media Encoder 11.0 or later. Media Encoder applies its most recently used preset. | +| `RenderQueue.canQueueInAME` | Read-only; only queued items can go to Media Encoder. | +| `RenderQueueItem.outputModule(index)` | 1 to `numOutputModules`. | +| `RenderQueueItem.applyTemplate(name)` | A render settings template. | +| `OutputModule.applyTemplate(templateName)` | An output module template; must be in `templates`. | +| `OutputModule.templates` | Names of the output module templates installed. | +| `OutputModule.file` | ExtendScript `File`, read/write. | +| `OutputModule.getSettings()` / `setSettings(...)` | From 13.0. The object can be invalidated after a settings change; fetch it again. | +| `OutputModule.saveAsTemplate(name)` | | + +## File and Folder + +From the JavaScript Tools Guide (): + +| Member | Notes | +| --- | --- | +| `new File(path)`, `new Folder(path)` | `~` is the user's home folder. | +| `file.exists`, `file.fsName`, `file.fullName` | `fsName` is the platform path; `fullName` is URI notation. | +| `file.encoding` | Set `"UTF-8"` before reading or writing text. | +| `file.open(mode)` | `"r"`, `"w"` (erases an existing file), `"a"`, `"e"`. | +| `file.write(...)`, `file.writeln(...)`, `file.read()`, `file.close()` | `close()` returns a Boolean. | +| `Folder.temp`, `Folder.desktop`, `Folder.myDocuments` | Standard folders. | +| `$.evalFile(path[, timeout])` | Runs another script file. | +| `$.writeln(text)` | To the debugger's console. | +| `$.os` | The operating system. | +| `$.level` | Set to 1 for breakpoints inside callbacks. | From 4bd2f27a7a0fb0812674277ab8aed570d3384afe Mon Sep 17 00:00:00 2001 From: John Haugabook Date: Tue, 10 Nov 2026 23:24:11 -0500 Subject: [PATCH 02/13] Add check for Gaussian Blur effect availability Check if 'Gaussian Blur 2' can be added before applying it. Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- skills/adobe-after-effects-scripting/SKILL.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/skills/adobe-after-effects-scripting/SKILL.md b/skills/adobe-after-effects-scripting/SKILL.md index 3a9e1842bb..c55a57e713 100644 --- a/skills/adobe-after-effects-scripting/SKILL.md +++ b/skills/adobe-after-effects-scripting/SKILL.md @@ -237,8 +237,13 @@ function effectMatchName(displayName) { } var parade = layer.property("ADBE Effect Parade"); -var blur = parade.addProperty(effectMatchName("Gaussian Blur")); -blur.property(1).setValue(12); +var blurMatchName = "ADBE Gaussian Blur 2"; +if (parade.canAddProperty(blurMatchName)) { + var blur = parade.addProperty(blurMatchName); + blur.property(1).setValue(12); +} else { + $.writeln("Effect unavailable: " + blurMatchName); +} ``` `app.effects` is an ordinary 0-based array of `{ displayName, category, From 41b8fe59965b0c50410435b0d62a95595cd96237 Mon Sep 17 00:00:00 2001 From: John Haugabook Date: Tue, 10 Nov 2026 23:29:19 -0500 Subject: [PATCH 03/13] bump adobe-illustrator plugin to 1.0.1 for the shared agent update The adobe-creative-cloud agent changed in this PR is also part of the adobe-illustrator plugin, so bump that plugin's version and regenerate marketplace.json so installed users are offered the update. Co-Authored-By: Claude Opus 5.5 --- .github/plugin/marketplace.json | 2 +- plugins/adobe-illustrator/plugin.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/plugin/marketplace.json b/.github/plugin/marketplace.json index eadfe749bd..362098b18c 100644 --- a/.github/plugin/marketplace.json +++ b/.github/plugin/marketplace.json @@ -57,7 +57,7 @@ "name": "adobe-illustrator", "source": "plugins/adobe-illustrator", "description": "Adobe Illustrator scripting, extension and plug-in development, MCP and command-line automation, and Creative Cloud asset management, led by an expert technical artist agent for Adobe Creative Cloud.", - "version": "1.0.0" + "version": "1.0.1" }, { "name": "agent-council", diff --git a/plugins/adobe-illustrator/plugin.json b/plugins/adobe-illustrator/plugin.json index 0841f22a76..54e319a21a 100644 --- a/plugins/adobe-illustrator/plugin.json +++ b/plugins/adobe-illustrator/plugin.json @@ -2,7 +2,7 @@ "$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json", "name": "adobe-illustrator", "description": "Adobe Illustrator scripting, extension and plug-in development, MCP and command-line automation, and Creative Cloud asset management, led by an expert technical artist agent for Adobe Creative Cloud.", - "version": "1.0.0", + "version": "1.0.1", "keywords": [ "adobe-illustrator", "illustrator", From 2166f8a764a79e66dcd102c6079db909cbb5bd91 Mon Sep 17 00:00:00 2001 From: John Haugabook Date: Tue, 10 Nov 2026 23:44:52 -0500 Subject: [PATCH 04/13] changes to new plugin adobe-after-effects --- skills/adobe-after-effects-scripting/SKILL.md | 17 ++++++++++++----- .../references/command-line.md | 5 +++-- .../references/object-model.md | 3 ++- 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/skills/adobe-after-effects-scripting/SKILL.md b/skills/adobe-after-effects-scripting/SKILL.md index c55a57e713..5ea498a011 100644 --- a/skills/adobe-after-effects-scripting/SKILL.md +++ b/skills/adobe-after-effects-scripting/SKILL.md @@ -89,7 +89,12 @@ Layer, AVLayer, TextLayer, ... - **Time is in seconds.** A frame is `frame * comp.frameDuration`. - **Units:** Position and Anchor Point in pixels, `[x, y]` on a 2D layer and `[x, y, z]` on a 3D one; Scale in percent per axis; Rotation in degrees; - Opacity 0 to 100; colours as `[r, g, b]` from 0 to 1. + Opacity 0 to 100; colours from 0 to 1. +- **Colours:** a colour property (`PropertyValueType.COLOR`: shape fills and + strokes, Color Control, effect colours) holds `[r, g, b, a]`. `setValue` + also accepts `[r, g, b]` there (alpha becomes 1), but an expression on it + must return four values ("expression result must be of dimension 4, not + 3"). `addSolid` and `TextDocument.fillColor` take `[r, g, b]`. - **`setValue` throws on a property that has keyframes.** Use `setValueAtTime` or `setValuesAtTimes` there. - **Adding to an indexed group invalidates references into it.** After @@ -174,13 +179,14 @@ function centerLayer(comp, layer) { .setValue([comp.width / 2, comp.height / 2]); } -/* Top-right corner, `margin` pixels in, at the layer's current scale. */ +/* Top-right corner, `margin` pixels in, at the layer's current scale. + Math.abs keeps a flipped (negative-scale) layer inside the margin. */ function alignTopRight(comp, layer, margin) { var transform = layer.property("ADBE Transform Group"); var rect = layer.sourceRectAtTime(0, false); var scale = transform.property("ADBE Scale").value; - var w = rect.width * scale[0] / 100; - var h = rect.height * scale[1] / 100; + var w = rect.width * Math.abs(scale[0]) / 100; + var h = rect.height * Math.abs(scale[1]) / 100; centerAnchor(layer); transform.property("ADBE Position") .setValue([comp.width - margin - w / 2, margin + h / 2]); @@ -273,7 +279,8 @@ om.file = new File("~/Desktop/demo-comp.mov"); app.project.renderQueue.render(); /* blocks until the render finishes */ ``` -- `om.templates` lists the output module templates this installation has; +- `om.templates` lists the output module templates this installation has, + and `rqItem.templates` the render settings templates; names differ between versions and languages, so check before applying one. - `RenderQueueItem.applyTemplate()` applies a **render settings** template; `OutputModule.applyTemplate()` applies an **output module** template. diff --git a/skills/adobe-after-effects-scripting/references/command-line.md b/skills/adobe-after-effects-scripting/references/command-line.md index 1bb5a86c60..75e7fe6b05 100644 --- a/skills/adobe-after-effects-scripting/references/command-line.md +++ b/skills/adobe-after-effects-scripting/references/command-line.md @@ -90,8 +90,9 @@ aerender -project "C:\Users\\Documents\acme\demo-project.aep" -comp "Demo aerender -project "C:\Users\\Documents\acme\demo-project.aep" -comp "Demo Comp" -RStemplate "Best Settings" -OMtemplate "High Quality" -output "C:\Users\\Documents\acme\out\demo-comp.mov" ``` -Template names must exist in the installation. List them from a script with -`OutputModule.templates`. +Template names must exist in the installation. List them from a script: +`RenderQueueItem.templates` for render settings (`-RStemplate`) and +`OutputModule.templates` for output modules (`-OMtemplate`). ## Adobe Media Encoder diff --git a/skills/adobe-after-effects-scripting/references/object-model.md b/skills/adobe-after-effects-scripting/references/object-model.md index af7d986336..5476df9b76 100644 --- a/skills/adobe-after-effects-scripting/references/object-model.md +++ b/skills/adobe-after-effects-scripting/references/object-model.md @@ -122,7 +122,8 @@ Effect match names come from `app.effects`. | `RenderQueue.queueInAME(render_immediately_in_AME)` | `false` only queues in Media Encoder; `true` also starts its queue. From 14.0; needs Media Encoder 11.0 or later. Media Encoder applies its most recently used preset. | | `RenderQueue.canQueueInAME` | Read-only; only queued items can go to Media Encoder. | | `RenderQueueItem.outputModule(index)` | 1 to `numOutputModules`. | -| `RenderQueueItem.applyTemplate(name)` | A render settings template. | +| `RenderQueueItem.applyTemplate(name)` | A render settings template; must be in `templates`. | +| `RenderQueueItem.templates` | Names of the render settings templates installed. | | `OutputModule.applyTemplate(templateName)` | An output module template; must be in `templates`. | | `OutputModule.templates` | Names of the output module templates installed. | | `OutputModule.file` | ExtendScript `File`, read/write. | From 0d1f21a92e520047fc8c7e1eb767720dffb3eab0 Mon Sep 17 00:00:00 2001 From: John Haugabook Date: Tue, 10 Nov 2026 23:59:14 -0500 Subject: [PATCH 05/13] changes to new plugin adobe-after-effects --- skills/adobe-after-effects-scripting/SKILL.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/skills/adobe-after-effects-scripting/SKILL.md b/skills/adobe-after-effects-scripting/SKILL.md index 5ea498a011..fd11ad5b1f 100644 --- a/skills/adobe-after-effects-scripting/SKILL.md +++ b/skills/adobe-after-effects-scripting/SKILL.md @@ -361,7 +361,13 @@ folder and from `Run Script File`: app.beginUndoGroup("Acme: Center Layers"); try { for (var i = 0; i < comp.selectedLayers.length; i++) { - centerLayer(comp, comp.selectedLayers[i]); + var layer = comp.selectedLayers[i]; + /* Cameras and lights have no sourceRectAtTime; text and shape + layers are not instanceof AVLayer, so name all three. */ + if (layer instanceof AVLayer || layer instanceof TextLayer || + layer instanceof ShapeLayer) { + centerLayer(comp, layer); + } } } finally { app.endUndoGroup(); @@ -381,6 +387,9 @@ folder and from `Run Script File`: Pass `this` in from the top level: inside a function, `this` is not the panel. `centerLayer` is the helper from [Center or align a layer](#center-or-align-a-layer). +It calls `sourceRectAtTime`, which camera and light layers lack: without the +check, the first camera or light in the selection throws and the rest of the +selection is never reached. ## Expressions @@ -425,6 +434,8 @@ Pass `this` in from the top level: inside a function, `this` is not the panel. - [ ] Loops run from 1 to `numItems` or `numLayers`, and count down when removing. - [ ] `app.project.activeItem` can be null or something other than a comp. +- [ ] Code that walks selected layers skips cameras and lights before it + calls `sourceRectAtTime`. - [ ] Properties are reached by match name. - [ ] Every reference into an effect group is fetched again after `addProperty`. From c2e5acfe9c4aea4dea6744454d43d4aa563af713 Mon Sep 17 00:00:00 2001 From: John Haugabook Date: Thu, 12 Nov 2026 19:28:29 -0500 Subject: [PATCH 06/13] changes to new plugin adobe-after-effects --- skills/adobe-after-effects-scripting/SKILL.md | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/skills/adobe-after-effects-scripting/SKILL.md b/skills/adobe-after-effects-scripting/SKILL.md index fd11ad5b1f..d1f1ba8949 100644 --- a/skills/adobe-after-effects-scripting/SKILL.md +++ b/skills/adobe-after-effects-scripting/SKILL.md @@ -233,15 +233,6 @@ if (rotation.canSetExpression) { ### Effects ```jsx -function effectMatchName(displayName) { - for (var i = 0; i < app.effects.length; i++) { - if (app.effects[i].displayName === displayName) { - return app.effects[i].matchName; - } - } - return null; -} - var parade = layer.property("ADBE Effect Parade"); var blurMatchName = "ADBE Gaussian Blur 2"; if (parade.canAddProperty(blurMatchName)) { @@ -254,8 +245,11 @@ if (parade.canAddProperty(blurMatchName)) { `app.effects` is an ordinary 0-based array of `{ displayName, category, matchName, version }`. Apply effects by `matchName`, which does not change -between versions or languages; the lookup by display name above is only for -finding it once. +between versions or languages. Never look an effect up by `displayName` in a +script: display names follow the user interface language, so the lookup finds +nothing on a localized installation. To find a match name while writing the +script, apply the effect once and read it back +(`layer.property("ADBE Effect Parade").property(1).matchName`). ### Text From 2de17f5977318e47234096e0decef33d19c6dce5 Mon Sep 17 00:00:00 2001 From: John Haugabook Date: Thu, 12 Nov 2026 20:01:01 -0500 Subject: [PATCH 07/13] changes to new plugin adobe-after-effects --- skills/adobe-after-effects-scripting/SKILL.md | 59 +++++++++++++++---- 1 file changed, 47 insertions(+), 12 deletions(-) diff --git a/skills/adobe-after-effects-scripting/SKILL.md b/skills/adobe-after-effects-scripting/SKILL.md index d1f1ba8949..3dbfb0882e 100644 --- a/skills/adobe-after-effects-scripting/SKILL.md +++ b/skills/adobe-after-effects-scripting/SKILL.md @@ -167,32 +167,58 @@ function buildDemo() { ### Center or align a layer ```jsx +/* Set x and y on the current value, so a 3D layer keeps its z. */ +function setXY(prop, x, y) { + var value = prop.value; + value[0] = x; + value[1] = y; + prop.setValue(value); +} + +/* setValue throws on a keyframed property, and on Position once its + dimensions are separated, so the helpers leave those layers alone. */ +function canSetTransform(layer) { + var transform = layer.property("ADBE Transform Group"); + var position = transform.property("ADBE Position"); + return transform.property("ADBE Anchor Point").numKeys === 0 && + position.numKeys === 0 && !position.dimensionsSeparated; +} + function centerAnchor(layer) { var rect = layer.sourceRectAtTime(0, false); - layer.property("ADBE Transform Group").property("ADBE Anchor Point") - .setValue([rect.left + rect.width / 2, rect.top + rect.height / 2]); + setXY(layer.property("ADBE Transform Group").property("ADBE Anchor Point"), + rect.left + rect.width / 2, rect.top + rect.height / 2); } +/* Returns false, changing nothing, when the transform cannot be set. */ function centerLayer(comp, layer) { + if (!canSetTransform(layer)) { return false; } centerAnchor(layer); - layer.property("ADBE Transform Group").property("ADBE Position") - .setValue([comp.width / 2, comp.height / 2]); + setXY(layer.property("ADBE Transform Group").property("ADBE Position"), + comp.width / 2, comp.height / 2); + return true; } /* Top-right corner, `margin` pixels in, at the layer's current scale. Math.abs keeps a flipped (negative-scale) layer inside the margin. */ function alignTopRight(comp, layer, margin) { + if (!canSetTransform(layer)) { return false; } var transform = layer.property("ADBE Transform Group"); var rect = layer.sourceRectAtTime(0, false); var scale = transform.property("ADBE Scale").value; var w = rect.width * Math.abs(scale[0]) / 100; var h = rect.height * Math.abs(scale[1]) / 100; centerAnchor(layer); - transform.property("ADBE Position") - .setValue([comp.width - margin - w / 2, margin + h / 2]); + setXY(transform.property("ADBE Position"), comp.width - margin - w / 2, margin + h / 2); + return true; } ``` +A two-value `setValue` on a 3D layer's Anchor Point or Position sets z to 0 +(checked in 26.0), so `setXY` changes only x and y. To move a keyframed layer, +write a keyframe at the current time with `setValueAtTime(comp.time, value)`; +these helpers skip it instead of changing an animation. + Stacking order: `moveToBeginning()` (top), `moveToEnd()` (bottom), `moveBefore(other)`, `moveAfter(other)`. @@ -354,15 +380,20 @@ folder and from `Run Script File`: if (!(comp instanceof CompItem)) { return; } app.beginUndoGroup("Acme: Center Layers"); try { + var skipped = 0; for (var i = 0; i < comp.selectedLayers.length; i++) { var layer = comp.selectedLayers[i]; /* Cameras and lights have no sourceRectAtTime; text and shape layers are not instanceof AVLayer, so name all three. */ - if (layer instanceof AVLayer || layer instanceof TextLayer || - layer instanceof ShapeLayer) { - centerLayer(comp, layer); + var supported = layer instanceof AVLayer || layer instanceof TextLayer || + layer instanceof ShapeLayer; + if (!supported || !centerLayer(comp, layer)) { + skipped++; } } + if (skipped) { + writeLn("Acme: skipped " + skipped + " camera, light, or animated layer(s)."); + } } finally { app.endUndoGroup(); } @@ -381,9 +412,11 @@ folder and from `Run Script File`: Pass `this` in from the top level: inside a function, `this` is not the panel. `centerLayer` is the helper from [Center or align a layer](#center-or-align-a-layer). -It calls `sourceRectAtTime`, which camera and light layers lack: without the -check, the first camera or light in the selection throws and the rest of the -selection is never reached. +It calls `sourceRectAtTime`, which camera and light layers lack, and returns +`false` without changing anything when a layer's Anchor Point or Position is +keyframed or has separated dimensions. Without these checks, the first such +layer in the selection throws and the rest of the selection is never reached. +`writeLn` reports the skipped layers in the Info panel. ## Expressions @@ -430,6 +463,8 @@ selection is never reached. - [ ] `app.project.activeItem` can be null or something other than a comp. - [ ] Code that walks selected layers skips cameras and lights before it calls `sourceRectAtTime`. +- [ ] Anchor Point and Position are set without dropping z on 3D layers, and + keyframed or separated transforms are skipped or keyed, not `setValue`d. - [ ] Properties are reached by match name. - [ ] Every reference into an effect group is fetched again after `addProperty`. From 026a1387197e0846b1db9acb2388f1a5442de55a Mon Sep 17 00:00:00 2001 From: John Haugabook Date: Thu, 12 Nov 2026 20:22:11 -0500 Subject: [PATCH 08/13] Enhance transform checks in canSetTransform and alignTopRight Updated canSetTransform function to check for parent layers and modified alignTopRight function to include a check for threeDLayer and rotation. Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- skills/adobe-after-effects-scripting/SKILL.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/skills/adobe-after-effects-scripting/SKILL.md b/skills/adobe-after-effects-scripting/SKILL.md index 3dbfb0882e..3b4353cb01 100644 --- a/skills/adobe-after-effects-scripting/SKILL.md +++ b/skills/adobe-after-effects-scripting/SKILL.md @@ -180,7 +180,7 @@ function setXY(prop, x, y) { function canSetTransform(layer) { var transform = layer.property("ADBE Transform Group"); var position = transform.property("ADBE Position"); - return transform.property("ADBE Anchor Point").numKeys === 0 && + return !layer.parent && transform.property("ADBE Anchor Point").numKeys === 0 && position.numKeys === 0 && !position.dimensionsSeparated; } @@ -202,8 +202,9 @@ function centerLayer(comp, layer) { /* Top-right corner, `margin` pixels in, at the layer's current scale. Math.abs keeps a flipped (negative-scale) layer inside the margin. */ function alignTopRight(comp, layer, margin) { - if (!canSetTransform(layer)) { return false; } + if (!canSetTransform(layer) || layer.threeDLayer) { return false; } var transform = layer.property("ADBE Transform Group"); + if (transform.property("ADBE Rotate Z").value !== 0) { return false; } var rect = layer.sourceRectAtTime(0, false); var scale = transform.property("ADBE Scale").value; var w = rect.width * Math.abs(scale[0]) / 100; From d8af6efffbf8fa64460e56069f4e89f9ba5d81c6 Mon Sep 17 00:00:00 2001 From: John Haugabook Date: Thu, 12 Nov 2026 20:35:53 -0500 Subject: [PATCH 09/13] changes to new plugin adobe-after-effects --- skills/adobe-after-effects-scripting/SKILL.md | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/skills/adobe-after-effects-scripting/SKILL.md b/skills/adobe-after-effects-scripting/SKILL.md index 3b4353cb01..4869da8edd 100644 --- a/skills/adobe-after-effects-scripting/SKILL.md +++ b/skills/adobe-after-effects-scripting/SKILL.md @@ -176,7 +176,8 @@ function setXY(prop, x, y) { } /* setValue throws on a keyframed property, and on Position once its - dimensions are separated, so the helpers leave those layers alone. */ + dimensions are separated; a parented layer's Position is in its parent's + space. The helpers leave all of these layers alone. */ function canSetTransform(layer) { var transform = layer.property("ADBE Transform Group"); var position = transform.property("ADBE Position"); @@ -200,7 +201,9 @@ function centerLayer(comp, layer) { } /* Top-right corner, `margin` pixels in, at the layer's current scale. - Math.abs keeps a flipped (negative-scale) layer inside the margin. */ + Math.abs keeps a flipped (negative-scale) layer inside the margin. It + declines 3D layers (away from z 0 the camera's perspective moves them off + the margin) and rotated layers (their corners stick out). */ function alignTopRight(comp, layer, margin) { if (!canSetTransform(layer) || layer.threeDLayer) { return false; } var transform = layer.property("ADBE Transform Group"); @@ -393,7 +396,7 @@ folder and from `Run Script File`: } } if (skipped) { - writeLn("Acme: skipped " + skipped + " camera, light, or animated layer(s)."); + writeLn("Acme: skipped " + skipped + " camera, light, parented, or animated layer(s)."); } } finally { app.endUndoGroup(); @@ -414,9 +417,10 @@ folder and from `Run Script File`: Pass `this` in from the top level: inside a function, `this` is not the panel. `centerLayer` is the helper from [Center or align a layer](#center-or-align-a-layer). It calls `sourceRectAtTime`, which camera and light layers lack, and returns -`false` without changing anything when a layer's Anchor Point or Position is -keyframed or has separated dimensions. Without these checks, the first such -layer in the selection throws and the rest of the selection is never reached. +`false` without changing anything when a layer is parented or its Anchor Point +or Position is keyframed or has separated dimensions. Without these checks, a +camera, light, or animated layer in the selection throws and the rest of the +selection is never reached, and a parented layer moves in its parent's space. `writeLn` reports the skipped layers in the Info panel. ## Expressions @@ -465,7 +469,8 @@ layer in the selection throws and the rest of the selection is never reached. - [ ] Code that walks selected layers skips cameras and lights before it calls `sourceRectAtTime`. - [ ] Anchor Point and Position are set without dropping z on 3D layers, and - keyframed or separated transforms are skipped or keyed, not `setValue`d. + keyframed, separated, or parented transforms are skipped or keyed, not + `setValue`d. - [ ] Properties are reached by match name. - [ ] Every reference into an effect group is fetched again after `addProperty`. From a84394f94f3b0a481cc45882cbba6d8f9706b45f Mon Sep 17 00:00:00 2001 From: John Haugabook Date: Sat, 14 Nov 2026 19:06:36 -0500 Subject: [PATCH 10/13] changes to new plugin adobe-after-effects --- skills/adobe-after-effects-scripting/SKILL.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/skills/adobe-after-effects-scripting/SKILL.md b/skills/adobe-after-effects-scripting/SKILL.md index 4869da8edd..bd1c4c9c8d 100644 --- a/skills/adobe-after-effects-scripting/SKILL.md +++ b/skills/adobe-after-effects-scripting/SKILL.md @@ -167,9 +167,9 @@ function buildDemo() { ### Center or align a layer ```jsx -/* Set x and y on the current value, so a 3D layer keeps its z. */ +/* Set x and y on the pre-expression value, so a 3D layer keeps its z. */ function setXY(prop, x, y) { - var value = prop.value; + var value = prop.valueAtTime(0, true); value[0] = x; value[1] = y; prop.setValue(value); From 1c09fca7068c10b38f67380a5ab1fedec00ba20e Mon Sep 17 00:00:00 2001 From: John Haugabook Date: Sat, 14 Nov 2026 19:26:04 -0500 Subject: [PATCH 11/13] Refactor command handling and layer stretch logic Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- .../references/bridges-and-mcp.md | 6 +++++- skills/adobe-after-effects-scripting/SKILL.md | 4 +++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/skills/adobe-after-effects-integrations/references/bridges-and-mcp.md b/skills/adobe-after-effects-integrations/references/bridges-and-mcp.md index 3480988521..3b8d65a74d 100644 --- a/skills/adobe-after-effects-integrations/references/bridges-and-mcp.md +++ b/skills/adobe-after-effects-integrations/references/bridges-and-mcp.md @@ -38,7 +38,11 @@ function acmeCheckMailbox() { command.open("r"); var text = command.read(); command.close(); - command.remove(); /* consume it first, so a bad command cannot repeat */ + if (!command.remove()) { + acmeWriteAtomically(acmeMailbox.fsName + "/result.json", + JSON.stringify({ ok: false, error: "Could not consume command.json; no command was run." })); + return; + } var reply; try { var request = JSON.parse(text); diff --git a/skills/adobe-after-effects-scripting/SKILL.md b/skills/adobe-after-effects-scripting/SKILL.md index bd1c4c9c8d..61b80beee8 100644 --- a/skills/adobe-after-effects-scripting/SKILL.md +++ b/skills/adobe-after-effects-scripting/SKILL.md @@ -182,7 +182,8 @@ function canSetTransform(layer) { var transform = layer.property("ADBE Transform Group"); var position = transform.property("ADBE Position"); return !layer.parent && transform.property("ADBE Anchor Point").numKeys === 0 && - position.numKeys === 0 && !position.dimensionsSeparated; + !transform.property("ADBE Anchor Point").expressionEnabled && + position.numKeys === 0 && !position.expressionEnabled && !position.dimensionsSeparated; } function centerAnchor(layer) { @@ -237,6 +238,7 @@ function fitToLength(comp, layer, seconds) { if (natural > seconds) { layer.stretch = seconds / natural * 100; } else { + layer.stretch = 100; comp.workAreaStart = layer.inPoint; comp.workAreaDuration = natural; } From b07641d8de03ca1d6c6e91e375375293757b4fba Mon Sep 17 00:00:00 2001 From: John Haugabook Date: Sat, 14 Nov 2026 20:05:24 -0500 Subject: [PATCH 12/13] changes to new plugin adobe-after-effects --- skills/adobe-after-effects-scripting/SKILL.md | 44 ++++++++----------- .../references/command-line.md | 13 +++++- .../references/object-model.md | 1 + 3 files changed, 31 insertions(+), 27 deletions(-) diff --git a/skills/adobe-after-effects-scripting/SKILL.md b/skills/adobe-after-effects-scripting/SKILL.md index 61b80beee8..136e42aba8 100644 --- a/skills/adobe-after-effects-scripting/SKILL.md +++ b/skills/adobe-after-effects-scripting/SKILL.md @@ -31,9 +31,11 @@ tools send into After Effects belongs here. as a docked panel, at startup, or unattended from the command line. An unattended script must never open a dialog: a modal dialog blocks every script after it. -3. **Know what it touches.** Writing files, reading them outside the project, - or using `Socket` needs the preference **Allow Scripts To Write Files And - Access Network** (see [Running scripts](#running-scripts)). +3. **Know what it touches.** Writing, renaming or removing files, creating + folders, and using `Socket` need the preference **Allow Scripts To Write + Files And Access Network** (see [Running scripts](#running-scripts)); + reading a file does not. Without it those calls throw, but `open("w")` + still empties the file: [check it first](references/object-model.md#file-and-folder). 4. **Write ES3**, or compile down to it (see [The language](#the-language)). ## The language @@ -177,7 +179,8 @@ function setXY(prop, x, y) { /* setValue throws on a keyframed property, and on Position once its dimensions are separated; a parented layer's Position is in its parent's - space. The helpers leave all of these layers alone. */ + space, and an enabled expression overrides the value set. The helpers + leave all of these layers alone. */ function canSetTransform(layer) { var transform = layer.property("ADBE Transform Group"); var position = transform.property("ADBE Position"); @@ -224,9 +227,6 @@ A two-value `setValue` on a 3D layer's Anchor Point or Position sets z to 0 write a keyframe at the current time with `setValueAtTime(comp.time, value)`; these helpers skip it instead of changing an animation. -Stacking order: `moveToBeginning()` (top), `moveToEnd()` (bottom), -`moveBefore(other)`, `moveAfter(other)`. - ### Fit footage to a length `stretch` is a percentage of the layer's duration, not its speed: 100 is @@ -319,18 +319,10 @@ app.project.renderQueue.render(); /* blocks until the render finishes */ - `layer.audioEnabled = false` silences one layer; whether a file gets an audio track at all is the output module's setting. -**Adobe Media Encoder** instead of the internal renderer: - -```jsx -if (app.project.renderQueue.canQueueInAME) { - app.project.renderQueue.queueInAME(false); /* true also starts the AME queue */ -} -``` - -Only items whose status is queued are sent. Media Encoder applies **its most -recently used encoding preset**, not the output module template, so set the -format in Media Encoder. Requires After Effects 14.0 and Media Encoder 11.0 or -later. +**Adobe Media Encoder** instead of the internal renderer: `queueInAME(false)` +sends the queued items, and Media Encoder applies **its most recently used +encoding preset**, not the output module template. See +[references/command-line.md](references/command-line.md#adobe-media-encoder). ### Save and close @@ -398,7 +390,8 @@ folder and from `Run Script File`: } } if (skipped) { - writeLn("Acme: skipped " + skipped + " camera, light, parented, or animated layer(s)."); + writeLn("Acme: skipped " + skipped + + " camera, light, parented, animated, or expression-driven layer(s)."); } } finally { app.endUndoGroup(); @@ -420,9 +413,10 @@ Pass `this` in from the top level: inside a function, `this` is not the panel. `centerLayer` is the helper from [Center or align a layer](#center-or-align-a-layer). It calls `sourceRectAtTime`, which camera and light layers lack, and returns `false` without changing anything when a layer is parented or its Anchor Point -or Position is keyframed or has separated dimensions. Without these checks, a -camera, light, or animated layer in the selection throws and the rest of the -selection is never reached, and a parented layer moves in its parent's space. +or Position is keyframed, has an enabled expression, or has separated +dimensions. Without these checks, a camera, light, or animated layer in the +selection throws and the rest of the selection is never reached, a parented +layer moves in its parent's space, and an expression overrides the new value. `writeLn` reports the skipped layers in the Info panel. ## Expressions @@ -471,8 +465,8 @@ selection is never reached, and a parented layer moves in its parent's space. - [ ] Code that walks selected layers skips cameras and lights before it calls `sourceRectAtTime`. - [ ] Anchor Point and Position are set without dropping z on 3D layers, and - keyframed, separated, or parented transforms are skipped or keyed, not - `setValue`d. + keyframed, separated, parented, or expression-driven transforms are + skipped or keyed, not `setValue`d. - [ ] Properties are reached by match name. - [ ] Every reference into an effect group is fetched again after `addProperty`. diff --git a/skills/adobe-after-effects-scripting/references/command-line.md b/skills/adobe-after-effects-scripting/references/command-line.md index 75e7fe6b05..75f8d1a4e3 100644 --- a/skills/adobe-after-effects-scripting/references/command-line.md +++ b/skills/adobe-after-effects-scripting/references/command-line.md @@ -96,8 +96,17 @@ Template names must exist in the installation. List them from a script: ## Adobe Media Encoder -From After Effects, `app.project.renderQueue.queueInAME(false)` sends queued -items to Media Encoder, which applies its most recently used preset. +From After Effects 14.0 and later, with Media Encoder 11.0 or later: + +```jsx +if (app.project.renderQueue.canQueueInAME) { + app.project.renderQueue.queueInAME(false); /* true also starts the AME queue */ +} +``` + +Only items whose status is queued are sent. Media Encoder applies its most +recently used encoding preset, not the output module template, so set the +format in Media Encoder. Media Encoder has its own scripting API (). Its top-level `app` offers `getFrontend()`, `getEncoderHost()`, diff --git a/skills/adobe-after-effects-scripting/references/object-model.md b/skills/adobe-after-effects-scripting/references/object-model.md index 5476df9b76..cf88544bf4 100644 --- a/skills/adobe-after-effects-scripting/references/object-model.md +++ b/skills/adobe-after-effects-scripting/references/object-model.md @@ -141,6 +141,7 @@ From the JavaScript Tools Guide (): | `file.encoding` | Set `"UTF-8"` before reading or writing text. | | `file.open(mode)` | `"r"`, `"w"` (erases an existing file), `"a"`, `"e"`. | | `file.write(...)`, `file.writeln(...)`, `file.read()`, `file.close()` | `close()` returns a Boolean. | +| `file.open("w")`, `file.write(...)`, `file.rename(name)`, `file.remove()`, `folder.create()` | Need **Allow Scripts To Write Files And Access Network**. Without it, `open("w")` returns `true` and empties the file, then `write`, `rename`, `remove` and `create` throw `ReferenceError: Permission denied` (checked in 26.0). Check `app.preferences.getPrefAsLong("Main Pref Section", "Pref_SCRIPTING_FILE_NETWORK_SECURITY")` first: 1 on, 0 off. Reading a file needs no permission. | | `Folder.temp`, `Folder.desktop`, `Folder.myDocuments` | Standard folders. | | `$.evalFile(path[, timeout])` | Runs another script file. | | `$.writeln(text)` | To the debugger's console. | From 8b631e18103990e0129369a9abb01590514de1c4 Mon Sep 17 00:00:00 2001 From: John Haugabook Date: Wed, 18 Nov 2026 16:30:49 -0500 Subject: [PATCH 13/13] Fix layer source rectangle and work area duration Updated layer source rectangle retrieval and work area duration calculation. Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- skills/adobe-after-effects-scripting/SKILL.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/skills/adobe-after-effects-scripting/SKILL.md b/skills/adobe-after-effects-scripting/SKILL.md index 136e42aba8..78acf7051d 100644 --- a/skills/adobe-after-effects-scripting/SKILL.md +++ b/skills/adobe-after-effects-scripting/SKILL.md @@ -212,11 +212,12 @@ function alignTopRight(comp, layer, margin) { if (!canSetTransform(layer) || layer.threeDLayer) { return false; } var transform = layer.property("ADBE Transform Group"); if (transform.property("ADBE Rotate Z").value !== 0) { return false; } - var rect = layer.sourceRectAtTime(0, false); + var rect = layer.sourceRectAtTime(comp.time, false); var scale = transform.property("ADBE Scale").value; var w = rect.width * Math.abs(scale[0]) / 100; var h = rect.height * Math.abs(scale[1]) / 100; - centerAnchor(layer); + setXY(transform.property("ADBE Anchor Point"), + rect.left + rect.width / 2, rect.top + rect.height / 2); setXY(transform.property("ADBE Position"), comp.width - margin - w / 2, margin + h / 2); return true; } @@ -239,9 +240,9 @@ function fitToLength(comp, layer, seconds) { layer.stretch = seconds / natural * 100; } else { layer.stretch = 100; - comp.workAreaStart = layer.inPoint; - comp.workAreaDuration = natural; } + comp.workAreaStart = layer.inPoint; + comp.workAreaDuration = Math.min(natural, seconds); } ```