InDesign2027
API 22.0.0.104
Product

InDesign

Adobe InDesign 2027 (22.0.0.104) Object Model. 1101 entries. What’s new since InDesign 2026 →

Start here

ExtendScript and UXP

InDesign runs scripts in two engines. Both drive the same object model — the objects, properties and methods on these pages. What differs is the language around it. The ExtendScript / UXP switch in the header shows every page as the chosen engine sees it.

ExtendScript

  • .jsx files, run from the Scripts panel
  • JavaScript at the level of ES3 (1999): var, no let, arrow functions or promises
  • app, every enumeration, File, Folder and $ are globals
  • doc.pages[0] or doc.pages.item(0)
  • Enumerations compare with ==
  • Property check: obj.hasOwnProperty("name") or "name" in obj
  • Arguments: app.scriptArgs.getValue("name"), or arguments in a script run by doScript()
  • The result is the value of the last expression
  • Dialogs with ScriptUI
// hello.jsx
var doc = app.documents.add();
var frame = doc.pages[0].textFrames.add();
frame.geometricBounds = [20, 20, 40, 120];
frame.contents = "Hello World";
var para = frame.paragraphs[0];
para.justification = Justification.CENTER_ALIGN;
if (para.justification == Justification.CENTER_ALIGN) {
  alert("centered");
}

UXP

  • .idjs files, run from the Scripts panel; UXP plugins since 18.5
  • Modern JavaScript: let, const, arrow functions, async/await
  • const { app } = require("indesign") — enumerations come from there too
  • doc.pages.item(0) only — there is no [0]
  • Enumerations compare with .equals(), not ==
  • Property check: "name" in obj only — hasOwnProperty() is always false on DOM objects
  • Arguments: require("uxp").script.args, an array of strings — app.scriptArgs does not exist
  • The result is what you pass to script.setResult(); the last expression is ignored
  • Files come from require("uxp").storage; file and folder properties return a Promise — await doc.fullName
  • No ScriptUI, no $, no E4X XML; the user interface is HTML
// hello.idjs
const { app, Justification } = require("indesign");
const doc = app.documents.add();
const frame = doc.pages.item(0).textFrames.add();
frame.geometricBounds = [20, 20, 40, 120];
frame.contents = "Hello World";
const para = frame.paragraphs.item(0);
para.justification = Justification.CENTER_ALIGN;
if (para.justification.equals(Justification.CENTER_ALIGN)) {
  console.log("centered");
}

For editors and AI agents

Types

ExtendScript is not a browser. With the DOM library loaded, Document, Event, Text and Window resolve to the browser versions and the declarations below them go unseen — doc.pages unknown, doc.createElement offered instead. Save this next to your scripts as jsconfig.json:

{
  "compilerOptions": { "lib": ["es5"], "types": [], "checkJs": false },
  "include": ["**/*.js", "**/*.d.ts"]
}

Objects 425

Collections 244

Enumerations 432