Run AI Scripts in InDesign
Abstract
A technical guide to running AI-written scripts in Adobe InDesign 2026. It explains what JSON, JSX and UXP files are, how to add the Creative Hut script pack to the Scripts panel, how to test that scripts run on your computer, and how to fix an error with a chatbot. It ends with a check to make before you print. The design method is in guide 4.2.
Keywords: InDesign script, JSX, UXP, JSON, Scripts panel, run script in InDesign, AI script for InDesign, ChatGPT, Claude, Gemini, Grok
What are JSON, JSX and UXP files?
Short answer. JSON holds your text, JSX builds the page, and UXP is a newer script type that does the same job as JSX.
Key facts
- JSON is data only. It does nothing until a script reads it, and any text editor can open it.
- JSX runs in InDesign 2026. ChatGPT, Claude, Gemini and Grok can all write it, so try the same prompt in each.
- UXP (.idjs) is newer and has fewer examples online, so chatbots make more mistakes with it. Build the JSX first.
- Keep the layout in the JSX and the words in the JSON. To change a title, edit the JSON and run the script again.
- Use one script type per document. Do not run the JSX and the UXP version on the same file.
{
"heading": "Table of Contents",
"entries": [
{ "num": "01", "title": "Unwatched" },
{ "num": "02", "title": "Tide of Hands" },
{ "num": "03", "title": "Ritual in Red" },
{ "num": "04", "title": "Rituals of Belonging" }
],
"photos": ["images/photo1.jpg", "images/photo2.jpg", "images/photo3.jpg"]
}How do you add a script to InDesign?
Short answer. Extract the pack, open the Scripts panel, reveal the Scripts Panel folder and copy the Creative Hut folder into it.
- Extract the zip. You get one folder called Creative Hut.
- In InDesign open Window > Utilities > Scripts.
- In the panel, right-click User and choose Reveal in Finder (Mac) or Reveal in Explorer (Windows).
- Open the folder called Scripts Panel.
- Copy the whole Creative Hut folder into it.
- If it does not show in the panel, close and reopen InDesign.
How do you test that scripts work on your computer?
Short answer. Run CH_Test_Setup. If it says Setup works, run the example script and open the Output folder.
- In the Scripts panel open Creative Hut > 00_Test_Setup and double-click CH_Test_Setup.
- A page opens and an alert says Setup works. Close the document without saving.
- Install the Montserrat font if you have not.
- Open 01_Example_Table_of_Contents and double-click CH_TOC_Example_Page05.
- When it finishes, open the TOC_Example_Output folder next to the script.
The Output folder holds
- The .indd file
- A backup copy with the date and time
- A print PDF with 3 mm bleed and crop marks
- A screen PDF
- A package folder
What do you do when a script fails?
Short answer. Copy the exact error and line number, paste them into the same chat with Prompt 3, and run the corrected script.
The script gave this error in InDesign 2026, version 22: [paste the exact error text and line number] Or the page looks wrong in this way: [describe what is wrong, and attach a screenshot] Fix only this problem. Do not change anything else. Give me the complete corrected script in one code block, and tell me in one line what changed.
This ExtendScript (.jsx) works in InDesign 2026, version 22. Convert it to a UXP script (.idjs) for the same InDesign version.
Rules: use the official Adobe InDesign UXP scripting API and modern JavaScript, load the app with require("indesign"), read page.json with the UXP file system, keep the same layout, styles, colours and export steps, and do not mix in ExtendScript code.
Give me the full .idjs code in one code block, and tell me in three lines what changed from the JSX.
[paste the working JSX]Check before you print
- Margins, grid and fonts match your page values.
- The page number shows the number you set.
- No text overflows its frame.
- The print PDF has bleed and crop marks.
- The files are in sRGB. Ask your printer whether they need CMYK before you send files.
- Save each working script under a new name before you ask for changes.
Questions beginners ask
Both are InDesign script types that do the same job. JSX is the older ExtendScript style and is the safer place to start. UXP (.idjs) is the newer style, written in modern JavaScript.
No. A chatbot writes the script. You need to give exact values, copy the files into the right folder and paste any error back into the chat.
Yes. Paste the same prompt into any of them. They only write the script. InDesign runs it.
The folder is probably in the wrong place. Right-click User in the Scripts panel, choose Reveal, and check that Creative Hut is inside the Scripts Panel folder. Then restart InDesign.
The pack and prompts are written for InDesign 2026 (version 22). Tell the chatbot your exact version if you use another one.
Make this your craft at Creative Hut Academy
Creative Hut Academy in Mattakkara, Kottayam, Kerala teaches photography, cinematography, editing, sound and AI filmmaking in one-year residential diplomas. Students come from across India.
Want to talk? Message us on WhatsApp, or ask Cham, our AI mentor, a study doubt.