build_captions
Convert transcripts or SRT files into timed caption text layers in After Effects, with word wrapping and styling, or a single expression-driven layer that displays active segments by time.
Instructions
Turn a transcript into timed, wrapped, styled caption text layers — closes the whisper→captions loop. Provide segments ([{text,start,end}] in seconds) OR srt (raw SRT string; "HH:MM:SS,mmm --> HH:MM:SS,mmm" blocks are parsed). mode="layers" (default) creates one text layer per segment timed to [start,end]; mode="single" creates ONE layer with a source-text expression that shows the active segment by time from an embedded table. maxCharsPerLine word-wraps long lines (0 = no wrap). style = { font, fontSize, fillColor (hex or [r,g,b(,a)]), position [x,y], justification, box (true or [w,h] for paragraph/box text) } — captions default to centered near the lower third. Returns { mode, created, layers:[...] } (single mode also returns expression + expressionError).
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "build_captions"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| srt | No | Raw SRT text (parsed instead of `segments`). | |
| comp | No | Comp: name (string), or { id: N } for duplicate-name-safe stable-id addressing. Defaults to active comp. | |
| mode | No | layers = one timed layer per segment; single = one expression-driven layer. | layers |
| name | No | Layer name (single mode). | |
| style | No | ||
| instance | No | Target a specific AE when more than one is connected (e.g. "2026", "2025", or a major like "26"). Omit when only one AE is open — see list_instances. | |
| segments | No | Caption segments in seconds. | |
| maxCharsPerLine | No | Word-wrap width in characters (0 = no wrap). |