EST. 2007
ADMISSIONS OPEN
Apply Now
← Creative Hut Library
Editing and design · Portfolio

Design Your Book’s Table of Contents with AI: A Worked Example

One real page, four images and exact values. The chatbot shows the design first, you approve it, and only then does it write the InDesign script.
9 min read

By Abin Alex and Anu Joseph

Creative Hut Academy Library · Updated 28 November 2026

Abstract

A worked example of designing a book’s table of contents page in Adobe InDesign 2026 with an AI chatbot. It starts from the student’s own layout and three reference images, lists the exact page values, and shows how to make ChatGPT, Claude, Gemini or Grok show the design first, change it, and approve it. Only then does it write the script, which is run as shown in guide 4.1. Every prompt has a copy button.

Keywords: table of contents design, InDesign layout, AI design prompts, InDesign script, book layout, design reference images, ChatGPT, Claude, Gemini, Grok

01 · Your four images

Which four images do you give the chatbot?

Short answer. Image 1 is your own page layout. Images 2, 3 and 4 are references that show only layout, type and mood.

Definition
A chatbot designs better from pictures than from words. Image 1 is the page you have drawn or laid out yourself, with your real content. It decides what goes on the page and where. Images 2, 3 and 4 are three references you like, such as pages from a book or a board you saved. They decide only the look: layout, type and mood. Do not copy their text or artwork, and do not publish them.
How to
Table of contents page layout example: a white page with the heading Table of Contents centred at the top, three tall photo strips across the page and four numbered entries between them: 01 Unwatched, 02 Tide of Hands, 03 Ritual in Red and 04 Rituals of Belonging
Image 1 of the example: the table of contents page layout used in this guide, with three photo strips and four numbered entries.

Rules for the four images

  • Save all four as JPG or PNG and name them image1_my_layout, image2_reference, image3_reference and image4_reference.
  • Use image 1 for the content and the positions.
  • Use images 2 to 4 for style only.
  • Upload all four in one message. The pack has a folder for them: 03_My_Images.
Cham task
Make your own image 1 for one page of your book, even a rough sketch, and choose three references.
End of 01 · Your four imagesNext: 02 · The page values
02 · The page values

Which values do you tell the chatbot?

Short answer. Software and version, page size, margins, grid with gutter, typography, colour and the outcome you want.

Definition
A chatbot cannot guess numbers. Give exact values and it will build the same page every time. These are the values for the example page in image 1.
How to
Example: page values
Software: Adobe InDesign 2026 (version 22)
Page size: 30.5 x 23.5 cm
Margins: 2.5 cm on all sides
Bleed: 3 mm
Colour space: sRGB
Grid: 5 columns across the live area, no gutter. Column 1, 3 and 5 are photo columns, 4.2 cm wide. Column 2 and 4 are text columns, about 6.4 cm wide.
Photos: three strips, 4.2 x 12 cm, placed in columns 1, 3 and 5
Heading: Table of Contents, centred at the top, Montserrat Bold 40 pt, with a thin grey rule below it
Entries: two in column 2 and two in column 4. Number in Montserrat 14 pt grey, title in Montserrat 18 pt black, a thin black divider between the two entries
Colours: black #141414, grey #8C8C8C
Page number shown: 5
Outcome: a print-ready table of contents page
Montserrat must be installed on your computer before you run the script. Tell the chatbot your software and version, because scripts for InDesign and Photoshop are different.
Cham tip
Use numbers, not adjectives. “Heading 40 pt” gives a better result than “big heading”.
Cham task
Write your own values in the same order before you move on.
End of 02 · The page valuesNext: 03 · Show the design first
03 · Show the design first

How do you make the chatbot show the design first?

Short answer. Upload your four images, paste Prompt 1 and ask for a picture and a spec. No code yet.

Definition
Design first, code second. If the picture is wrong the script will be wrong too, and fixing a picture is quicker than fixing code.
How to
  1. Open a new chat in ChatGPT, Claude, Gemini or Grok.
  2. Upload the four images in one message.
  3. Paste Prompt 1 with your values filled in.
  4. The chatbot shows the design, writes the spec and asks three questions.
  5. Answer the questions.
Prompt 1: Show me the design first (no code)
I am a design student designing a table of contents page (page 5) of a book.
Image 1 is my own layout. Images 2, 3 and 4 are references.
From image 1 take the content and the positions. From images 2, 3 and 4 take only layout, type and mood. Do not copy any text or artwork.

SOFTWARE: Adobe InDesign 2026, version 22, on [Mac or Windows]
PAGE: 30.5 x 23.5 cm, margins 2.5 cm, bleed 3 mm, colour space sRGB
GRID: 5 columns, no gutter. Columns 1, 3 and 5 are photo columns, 4.2 cm wide. Columns 2 and 4 are text columns, about 6.4 cm wide.
TYPE: Montserrat. Heading Bold 40 pt, entry titles 18 pt, numbers 14 pt
COLOUR: black #141414, grey #8C8C8C
OUTCOME: a print-ready table of contents page

Step 1: Show me the design as one picture (an image, or a preview page if you cannot make images). Do not write code.
Step 2: Under the picture, write the design spec as exact values.
Step 3: Ask me 3 questions about anything you are unsure of.
If the tool cannot make images, it should give a preview page. Do not accept code yet.
Cham task
Run Prompt 1 in two different chatbots and compare the two pictures with image 1.
End of 03 · Show the design firstNext: 04 · Change and approve
04 · Change and approve

How do you change the design until it matches yours?

Short answer. Compare the picture with image 1, ask for changes with Prompt 1B, and type Approved when it matches.

Definition
You are the art director. The chatbot’s first picture is a draft. Check position, sizes, spacing and colour against image 1, one thing at a time.
How to
  1. Put the chatbot’s picture next to image 1.
  2. List what differs: size, position, spacing, colour.
  3. Paste Prompt 1B with one change.
  4. Repeat until the picture matches.
  5. Type Approved.
Prompt 1B: Change the design
Keep everything the same. Change only this:
Make the numbers lighter grey and move the heading rule closer to the heading.

Show me the new design and update the spec.
Cham tip
Change one thing at a time. Several changes in one message are easy to miss.
Cham task
Make three changes with Prompt 1B and approve the design.
End of 04 · Change and approveNext: 05 · Create and run the script
05 · Create and run the script

How do you get the script and run it?

Short answer. After you type Approved, paste Prompt 2, save the files and run the script as shown in guide 4.1.

Definition
Only after you approve the design do you ask for code. The script then builds exactly the approved page. The pack also holds the finished example, CH_TOC_Example_Page05, so you can compare it with what your chatbot writes.
How to
  1. Paste Prompt 2 in the same chat.
  2. Save the .jsx and the .json from the chatbot in a plain text editor, not Word.
  3. Put them in a new folder inside Creative Hut, with an images folder holding your three photographs.
  4. Run the script from the Scripts panel. Steps are in guide 4.1, Run AI Scripts in InDesign.
  5. If InDesign shows an error, use Prompt 3 from guide 4.1.
Prompt 2: Build the script (only after you approve)
Approved. Now write the script that builds exactly this approved design.

Write an Adobe InDesign ExtendScript (.jsx) file for InDesign 2026, version 22, on [Mac or Windows].

Rules:
1. ES3 syntax only. No let, const, arrow functions or template strings.
2. Put a settings block at the top for sizes, colours, fonts and positions.
3. Read all text from a file called page.json in the same folder as the script. Read photograph file names from the same file and place them from an images folder next to the script. If a photograph is missing, draw a grey frame and warn me.
4. Create colour swatches, paragraph styles and character styles in code.
5. Check that each font is installed. If not, use Arial and tell me.
6. Warn me if text overflows.
7. Use try/catch and show a clear alert on any error.
8. Save the .indd, a backup copy with date and time, a print PDF with bleed and crop marks, and a screen PDF into an Output folder next to the script.

Give me:
1. The complete .jsx in one code block, with the file name above it.
2. The complete page.json in another code block, with the file name above it.
3. Five lines on how to run it.
Cham task
Run the example script from the pack first. Then build your own page from your four images.
End of 05 · Create and run the script

Questions beginners ask

Why four images and not just a description?

Pictures carry layout, spacing and mood that words miss. Image 1 gives the content and positions, and three references give the look, so the chatbot has less to guess.

Can I copy a reference exactly?

No. Take only layout, type and mood from the references. Do not copy their text or artwork, and do not publish them.

Can I use Photoshop instead of InDesign?

You can design the page, but tell the chatbot your software and version because the script code is different. A page with live text and a print PDF is easier in InDesign.

What if the chatbot ignores my grid?

Repeat the grid as numbers and ask it to list where each element sits, in cm, before it writes any code.

Can I reuse this for other pages?

Yes. Keep the same method, change the images and the values, and use one chat for each page.

© 2026 Creative Hut Academy. Written by Abin Alex and Anu Joseph. Last updated 28 November 2026. To copy, republish, translate or adapt any part of it, you need written permission. Ask through the contact page.
First time with scripts? Read 4.1, Run AI Scripts in InDesign →More guides in the Library →
Learn this hands on

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.