Repository navigation
Scripting: run scripts written for Illustrator (object model, .jsx, AppleScript, VBScript) #1210
Description
VectorCraft's scripting (#1161, PR #1183) runs .js files written against VectorCraft's own commands, through a global vc object. Scripts written for Adobe Illustrator don't run. Illustrator accepts these script types (Adobe: Install and run scripts, scripting guide):
| Script type | Status in VectorCraft |
|---|---|
JavaScript / ExtendScript (.jsx, .js) using Illustrator's object model (app.activeDocument, pathItems, swatches…) |
The language runs (Boa), but the object model doesn't exist, so these scripts fail at their first Illustrator call |
Compiled ExtendScript (.jsxbin) |
Not read |
AppleScript (.scpt, .applescript, macOS) |
VectorCraft can already be driven from AppleScript (see below), but scripts written for Illustrator (tell application "Adobe Illustrator") don't run unchanged: there is no scripting dictionary with Illustrator's object model |
VBScript (.vbs, Windows) |
VectorCraft can already be driven from VBScript (see below), but scripts written for Illustrator (CreateObject("Illustrator.Application")) don't run unchanged: there is no COM interface with Illustrator's object model |
What already works from other scripting languages
VectorCraft doesn't need OS automation to be controlled:
- Files, without the app open:
vectorcraft-cli(run,convert,script FILE.js [DOCUMENT] --out … --arg …) can be called from AppleScript'sdo shell script, from VBScript'sWScript.Shell, or from any shell or language. It works in its own process, on files. - The open document in a running app:
vectorcraft --control PORTtakes JSON lines on 127.0.0.1 (docs/control-protocol.md); any command can run, includingui.runScript {path}.vectorcraft-cli mcp --connectgives agents the same through MCP. The port is off unless the app is started with--control.
So this issue is about compatibility with existing Illustrator scripts, not about being scriptable at all.
Why it's separate
Running existing Illustrator scripts would need a compatibility layer: Illustrator's scripting object model rebuilt over VectorCraft's command registry. That model is large (documents, layers, page items, paths, text frames, colours, swatches, symbols, export options and more), and scripts rely on its exact behaviour. The clean-room rules in AGENTS.md limit behaviour sources to public documentation, so whether and how to build it from Adobe's published scripting reference is a maintainer decision.
Options
- ExtendScript object-model shim: expose
app,Document,PathItem… as JavaScript objects, written from the public scripting reference and implemented withvc.runanddocument.inspect. It could start from the subset common scripts use (documents, layers, paths, fills, selection, export) and grow from there..jsxwould then be offered in File › Scripts. - ExtendScript extras:
#include,#target,$.writeln, ScriptUI dialogs andFile/Folderaccess, each a separate decision. File access in particular would need to respect the automation roots. - Native OS interfaces for unchanged Illustrator AppleScript/VBScript: an AppleScript dictionary on macOS and a COM server on Windows that offer the same object model. These are separate projects with their own security questions. AppleScript and VBScript can already control VectorCraft through the CLI and the control port, so this matters only for running Illustrator's own scripts.
.jsxbin: likely out of scope (an Adobe-specific encoded format).
Not in scope of #1183
PR #1183 deliberately ships only VectorCraft's own .js API, plus File › Scripts' folder listing and recent scripts. This issue tracks the rest. It belongs to gap G6 (docs/gaps.md); the Automation row in docs/target-app-parity.md lists "Illustrator's scripting object model" as missing.
Activity