Bridging ExtendScript and UXP in Illustrator: which layer should own the automation logic?
0 reputation · 18 Dec 2025, 16:08 UTC
0 reputation · 18 Dec 2025, 16:08 UTC
We are designing an internal automation tool for Adobe Illustrator and need to decide how to split work between the legacy ExtendScript surface (.jsx run via File > Scripts or the VS Code ExtendScript Debugger) and the newer UXP scripting platform loaded through the UXP Developer Tool. Both are documented, supported paths, but they are not interchangeable.
The constraint is that UXP exposes a smaller, asynchronous, Promise-based API, while some document and application object members we rely on appear to exist only in ExtendScript. We also want to prototype the integration locally without any production credentials, marketplace signing, or server-side licensing — sideloading and local script execution only. A further uncertainty is version sensitivity: the UXP manifest and API surface have changed across Illustrator releases, so whatever we build must be re-verified per version.
Our open questions:
35275 reputation · 18 Dec 2025, 18:59 UTC
Put the automation logic in ExtendScript. Use UXP only for the user-facing panel, command palette entries, and any async workflows that require its modern APIs (e.g., `localFileSystem`, `clipboard`, `network`). Bridge the gap with app.doScript(extendScriptString, ScriptLanguage.EXTENDSCRIPT) — this is a documented, supported pattern used in Adobe's own UXP samples. Do not try to replicate the full ExtendScript DOM in UXP; the surface is intentionally smaller and changes per release.
doScript runs the ExtendScript synchronously inside the Illustrator process and returns a serialized value to the UXP Promise. Complex DOM objects (PageItem, TextFrame, Document) cannot cross the boundary — return plain data (IDs, JSON, primitive arrays) and re-fetch on the calling side.app properties, page-item internals, color profiles, text composers). UXP's require('illustrator') module exposes a curated subset focused on common tasks.osascript -e 'tell app "Adobe Illustrator" to do script "..."') and Windows (cscript //nologo script.jsx). UXP requires a running Illustrator instance and has no CLI entry point — structure CI around ExtendScript entry points.require('illustrator') vs. app.illustrator, permission declarations, entrypoints types). You must re-verify per target version.secureStorage and some localFileSystem permissions granted only to signed plugins. Test file I/O flows with the exact manifest permissions you intend to ship.localStorage), file pickers, clipboard, network calls, orchestration of async user flows. Call ExtendScript via doScript for heavy lifting.{action: 'getLayerTree', params: {docId: 123}} → ExtendScript returns {layers: [...]}. Keep payloads small; avoid circular references.manifest.json permissions you will ship with. Test localStorage persistence across Illustrator restarts — sideloaded plugins clear it on reload; signed plugins do not.osascript/cscript) locally to validate CI batch scripts before committing.# macOS
osascript -e 'tell application "Adobe Illustrator 2024" to do script "/path/to/batch.jsx"'
# Windows
cscript //nologo //E:jscript "C:\\Path\\batch.jsx"
Do not invoke UXP from CI. If a batch job needs UXP-only APIs (e.g., writing to a user-selected folder via localFileSystem), have the ExtendScript write a sidecar JSON file that a separately triggered UXP command reads on next UI session.
Which Illustrator versions (exact major releases, e.g., 27.x, 28.x, 29.x) must this tool support simultaneously? The UXP manifest version (v5 vs. v6) and require('illustrator') surface differ enough that a single codebase may need conditional shims or separate builds per version.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.