Appearance
Export / import script API
hm05 export / import scripts — types for VS Code autocompletion.
Put this file next to your script and start the script with
js
/// <reference path="./hm05-script.d.ts" />
// @ts-checkA script is one .js file (ES module).
EXPORT scripts (hm05.defineExporter) are loaded in Export → Format → "Script…". They run in a sandbox (a Web Worker): they get a READ-ONLY copy of the open document, cannot change the file and write their output through api.output. The editor puts the files in a ZIP (one file = that file alone) and downloads it.
IMPORT scripts (hm05.defineImporter, File → Import → "Import with Script…") read a file the user picks (and files next to it) and BUILD Library items — pictures, symbols with layers / keyframes, marker types and markers — through api.build. Nothing changes until the script ends; then everything it built goes in as ONE undo step.
Network: off unless the user ticks "Allow internet access" for the script (default off) — fetch is then available.
Units: positions / sizes are document units (stage pixels at 100%); pictures from api.render are output pixels (units × scale). Angles are DEGREES, clockwise (y points down, like the stage). Frames are 0-based (the timeline shows frame 1 for frame 0).
The script gets the global hm05 (Hm05Script.Global). The Export scripts guide walks through a first script.
Generated from packages/scripting/kit/hm05-script.d.ts (the file the editor's Script Kit button downloads).