AfterPresets runtime reference
What the AfterPresets runtime does, and which reference file to read before you use any AP.* API.
These files are for the AI coding agent that builds an After Effects or Premiere
Pro extension with AfterPresets. They describe the AP.* API that every panel gets.
What the runtime does
Section titled “What the runtime does”The runtime is a small script that the AfterPresets CLI puts in front of each panel’s JavaScript. It is logic only. It draws nothing: your project owns every screen, style, and word the user sees.
It gives you:
AP.bootto start the panel.- Licensing, off in
AP.bootby default (the starter project turns it on). Paid extensions must keep it on. - Signed updates with changelogs.
AP.host.evalto call ExtendScript functions in the app (After Effects or Premiere Pro).AP.panelsandAP.eventsfor extensions with more than one panel.AP.pathsto find the images, videos and other files you ship.AP.storageto save settings and other small data on this computer.
Do not edit the runtime and do not copy it into your source files. The CLI
adds it for you. ap docs refreshes this folder from the installed runtime.
The rule
Section titled “The rule”Read the relevant file below before you write or change code that uses
AP.*. Do not guess option names, statuses, or callback shapes. If a file
and your memory disagree, the file wins.
| File | Read it before you |
|---|---|
| boot.md | call AP.boot, use ctx, or change when the app starts |
| licensing.md | turn licensing on, write renderLicense, or change the license screen |
| updates.md | change update options or the update screen, or show a changelog |
| host.md | call the app from the panel or write jsx/ code |
| host-after-effects.md | write ExtendScript for After Effects (jsx/aeft/) |
| host-premiere.md | write ExtendScript for Premiere Pro (jsx/ppro/) |
| panels.md | add a panel or modal, open/close panels, or send data between panels |
| assets.md | add images, fonts, videos or other files, or import a file into the app |
| storage.md | save settings, recent items or any other data between launches |
Commands you will use
Section titled “Commands you will use”ap dev # build, link into the app, rebuild on changeap check # static checks; also run by ap dev and ap pushap add panel settings --type modalap push # publish a release (production: a draft you publish on the website)ap docs # refresh docs/afterpresets/ from the runtimeCompatibility
Section titled “Compatibility”Panels run in Adobe CEP 10 or later (After Effects 2020+, Premiere Pro 2020+). Its browser is old
(Chromium 74 in CEP 10). Modern JavaScript is fine in panel code (let/const,
arrow functions, classes, async/await, ?., ??): the build converts it
for Chromium 74. No top-level await, and built-in methods newer than
Chromium 74 need a fallback. ExtendScript in jsx/ stays ES3 (see
host.md).