Automatic flatplan generator for Adobe InDesign based on CSV data. This script allows you to quickly create pagination mockups with a modular structure and maintainable code.
- Automatic generation: Creates complete flatplans from a CSV file
- Color management: Automatic assignment of pastel colors by section
- Advertising support: Specialized handling of ads with fractional formats (1/2, 1/3, 1/4)
- Smart pagination: Automatic calculation of positions and spreads
- Visual separators: Separator lines every 4 pages to ease printing
- Modular structure: Code organized into reusable modules
flatplan-generator/
├── constants.jsx # Configuration and constants
├── utilities.jsx # Utility functions
├── colorManager.jsx # Color management
├── layoutCalculator.jsx # Positioning calculations
├── cardBuilder.jsx # Visual element construction
├── start.jsx # Main orchestration file
└── README.md
- Adobe InDesign (recent versions tested)
- InDesign template:
gabarit_pagin.indtwith the required masters - Required masters: “A-Master” and “B-Master”
- A CSV file formatted according to the expected structure
The CSV file must contain the following columns:
startPage,title,section,pageCount,advertiser,sector
1,"Main article",Editorial,2,,
3,"Toyota advertisement",Advertising,1,Toyota,Automotive
4,"News",News,3,,
Method 1: Modular files (recommended)
- Place all
.jsxfiles in the same folder - Adjust the template path in
constants.jsx:
var PATHS = {
templateFile: "path/to/your/template.indt"
};- Run
start.jsxin Adobe InDesign
Method 2: Manual loading Load the files in the following order in InDesign:
constants.jsxutilities.jsxcolorManager.jsxlayoutCalculator.jsxcardBuilder.jsxstart.jsx
Edit constants.jsx to customize:
- Card dimensions: width, section heights
- Colors: pastel color palette
- File paths: template and logs
- Text styles: sizes and alignments
Advertising management
- Support for fractional formats (1/2, 1/3, 1/4 page)
- Grey overlay with ad number
- Special formatting: “Advertiser – Sector”
Color system
- Automatic assignment by section
- 16 predefined pastel colors
- Consistent color reuse
Smart pagination
- Automatic spread calculation
- Multi-page handling
- Automatic master application
- Errors are automatically logged to
indesign_script_errors.log - Alert messages in case of issues
- Modular structure for easier debugging
This modular structure facilitates collaboration:
- Each module has a specific responsibility
- Easily extensible code
- Clear separation of concerns
Project developed for automated flatplan generation in an editorial production environment.