InDesign2027
API 22.0.0.104
Changes

What’s new in InDesign 2027

The scripting API of InDesign 2027 (22.0.0.104) compared with InDesign 2026 (21.5.1.73). 4 new objects, 67 changes on 16 objects, 0 that can break existing scripts. Generated from Adobe’s object model exports.

Highlights

Table summaries and Check Document

Tables and table styles carry a table summary for accessibility — Check Document looks for missing table summaries and alt text before export. Preferences set whether Check Document runs on export, whether generated table summaries get an AI tag, and whether alt text icons show in the layout.

Table.tableSummary · TableStyle.tableSummary · Application.checkDocumentOnExportPreference · GeneralPreference.addAITagToTableSummary · ViewPreference.showAltTextIcon

Grammar and copy suggestions

Every story and text range can check its grammar, report the issues as a JSON string and apply the suggested fixes; called on a document, the methods cover every story. Only for English (International) and English (North America). The two preferences are Enable Grammar Check and Enable Copy Suggestion.

Story.checkGrammar() · Story.getGrammarIssues() · Story.applyGrammarFix() · Story.applyAllGrammarFixes() · Story.requestGrammarCheck() · Application.grammarCheckPreference · Application.copySuggestionsPreference

JSON in ExtendScript

The application can read and write JSON — from a string or a file — without a polyfill. ExtendScript only; UXP has JSON built in.

  • An object comes as ["__jsonObject__", [[key, value], …]], nested objects too; arrays stay plain arrays.
  • stringifyJson() and writeJsonFile() take arrays, strings, numbers and booleans directly, but reject a plain object anywhere in the data — convert it first, as toPairs() does below.
  • Keys come back sorted alphabetically, on reading and on writing. If key order matters, use a JSON polyfill instead.
  • Invalid JSON throws an error whose message is just parseJson.
  • ExtendScript still has no global JSON, and toSource() is no substitute: ({a:1}) is not JSON.

Application.parseJson() · Application.parseJsonFile() · Application.stringifyJson() · Application.writeJsonFile()

// json.jsx
// Objects come as ["__jsonObject__", [[key, value], ...]], arrays as arrays.
function toObject(v) {
  if (!(v instanceof Array)) return v;
  var r = [], i;
  if (v[0] === "__jsonObject__") {
    r = {};
    for (i = 0; i < v[1].length; i++) r[v[1][i][0]] = toObject(v[1][i][1]);
  } else {
    for (i = 0; i < v.length; i++) r.push(toObject(v[i]));
  }
  return r;
}
function toPairs(v) {
  if (v === null || typeof v !== "object") return v;
  var r = [], k;
  if (v instanceof Array) {
    for (k = 0; k < v.length; k++) r.push(toPairs(v[k]));
    return r;
  }
  for (k in v) if (v.hasOwnProperty(k)) r.push([k, toPairs(v[k])]);
  return ["__jsonObject__", r];
}

var file = File(Folder.desktop + "/settings.json");
var settings = file.exists ? toObject(app.parseJsonFile(file.fsName)) : { runs: 0 };
settings.runs++;
settings.lastRun = new Date().toString();
app.writeJsonFile(file.fsName, toPairs(settings), true); // true: indented

Generative AI

New objects describe AI models and the images they generated in a document. Almost all of their properties are read-only, and scripts cannot add models. ExtendScript only.

GenAIModel · GenAIModels · GenAIImage · GenAIImages · Document.genaiModels

Breaking 0

Nothing removed or broken.

New objects 4

On many objects 5

Adobe lists inherited members on every object, so one addition shows up many times.

By object 6

Application

  • +property checkDocumentOnExportPreference BooleanWhether Check Document (Consistency and Table Summary checks) automatically runs when exporting. A session/application preference (the same one in Preferences > Generative AI).
  • +property copySuggestionsPreference BooleanWhether copy suggestions are enabled. A session/application preference.
  • +property grammarCheckPreference BooleanWhether grammar checking is enabled. A session/application preference (the same one in Preferences > Spelling).
  • +method parseJson()(jsonString) → VariesParses a JSON string using the uxtech JSON parser (rapidjson). Same decoding as parse json file, but reads the JSON text from a string already in memory instead of from a file.
  • +method parseJsonFile()(jsonFilePath) → VariesReads a JSON file from disk and parses it using the uxtech JSON parser (rapidjson).
  • +method stringifyJson()(jsonContents, makePretty?) → StringEncodes a value in the same [key, value]-pair shape returned by parse json (or parse json file) back into a JSON string using the uxtech JSON encoder. Same encoding as write json file, but returns the JSON text instead of writing it to a file.
  • +method writeJsonFile()(jsonFilePath, jsonContents, makePretty?) → BooleanEncodes a value previously returned by parse json file (or built in the same [key, value]-pair shape) back into JSON using the uxtech JSON encoder, and writes it to disk.

Document

GeneralPreference

Table

  • +property tableSummary StringThe accessibility summary (alt text) associated with the table. Use an empty string to disable.

TableStyle

  • +property tableSummary StringThe accessibility summary (alt text) associated with the table. Use an empty string to disable.

ViewPreference