InDesign Server2025
API 20.5.0.49
Product

InDesign Server

Adobe InDesign Server 2025 (20.5.0.49) Object Model. 966 entries.

Start here

ExtendScript and UXP

InDesign Server 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, and on a server above all how a script gets its arguments and how it hands back its result. The ExtendScript / UXP switch in the header shows every page as the chosen engine sees it.

ExtendScript

  • .jsx files, run on behalf of a client
  • Arguments: app.scriptArgs.getValue("name")
  • The result sent back to the client is the value of the last expression
  • 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
  • Dialogs with ScriptUI
// server.jsx
var args = app.scriptArgs;
var name = args.isDefined("name") ? args.getValue("name") : "World";
var doc = app.documents.add();
var frame = doc.pages[0].textFrames.add();
frame.geometricBounds = [20, 20, 40, 120];
frame.contents = "Hello " + name;
frame.paragraphs[0].justification = Justification.CENTER_ALIGN;
var result = frame.contents;
doc.close(SaveOptions.NO);
result; // returned to the client

UXP

  • .idjs files, run on behalf of a client; UXP plugins since 18.5
  • Arguments: require("uxp").script.args, an array of strings such as "name=value" — app.scriptArgs does not exist
  • The result sent back to the client is what you pass to script.setResult(); the last expression is ignored
  • 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
  • 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
// server.idjs
const { app, Justification, SaveOptions } = require("indesign");
const { script } = require("uxp");
const arg = script.args.find(a => a.startsWith("name="));
const doc = app.documents.add();
const frame = doc.pages.item(0).textFrames.add();
frame.geometricBounds = [20, 20, 40, 120];
frame.contents = "Hello " + (arg ? arg.slice(5) : "World");
frame.paragraphs.item(0).justification = Justification.CENTER_ALIGN;
const result = frame.contents;
doc.close(SaveOptions.NO);
script.setResult(result); // returned to the client

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 373

Collections 207

Enumerations 386