InDesign scripts, Python, PowerShell. We automate repetitive operations in the publication typesetting process so they are created faster, cheaper, and without errors.
Typesetting publications is largely repetitive work: importing text, applying styles, formatting tables, numbering elements, exporting files. Each of these activities performed manually takes time and generates the risk of error. DTP automation allows you to transfer these operations to scripts that perform them in seconds, always the same way and always correctly. For over twenty years we have been writing tools that speed up our work and the work of our clients.
We write scripts that automate operations in Adobe InDesign. From simple macros (apply a style to a selection) to extensive batch processing systems with a user interface and exception handling. We work both in ExtendScript (compatibility with InDesign CS6+) and in the new UXP API.
We connect data sources (Excel, CSV, XML, SQL databases) with InDesign templates. The script fetches the data, creates pages, fills text and graphic frames, and applies conditional formatting. Perfect for product catalogs, price lists, and cyclic reports where the content changes but the layout remains constant.
We automate operations on PDF files outside of InDesign. Ghostscript for generating, merging and splitting PDF files, color conversion, size reduction, and extraction of selected pages. PyMuPDF (fitz) for analyzing document structure, extracting text with positions, comparing versions, and generating reports on differences between revisions.
Not everything can be done inside InDesign. Source file preparation, format conversion, graphic processing, data validation. For these tasks, we use Python and PowerShell: scripts running outside InDesign that prepare material for automatic typesetting or process exported files.
Manual typesetting of a 120-page magazine requires dozens of hours of operator work. A significant portion of this time is spent on mechanical tasks: importing text from Word, removing unnecessary formatting, applying paragraph and character styles, formatting tables, inserting and scaling graphics, building tables of contents. Each of these operations is prone to human error: a missed style, the wrong font in one table cell, a missing conjunction at the beginning of a line.
Typesetting automation does not eliminate the operator, but it changes the nature of their work. Instead of performing hundreds of identical clicks, the operator oversees the process, makes typographic decisions, and corrects cases requiring individual evaluation. Scripts take over what is repetitive. The result: shorter deadlines, fewer corrections in subsequent revisions, lower production costs for subsequent editions.
// Remove conjunctions from the end of a line
var doc = app.activeDocument;
var grep = {
findWhat: "(\\s)([aiouwzAIOUWZ])\\s",
changeTo: "$1$2~S"
};
app.findGrepPreferences = grep;
app.changeGrepPreferences = grep;
doc.changeGrep();
# Graphic validation before import
from pathlib import Path
from PIL import Image
def check_resolution(folder, min_dpi=300):
for img in Path(folder).glob("*.tif"):
with Image.open(img) as im:
dpi = im.info.get("dpi", (72,72))
if dpi[0] < min_dpi:
print(f"⚠ {img.name}: {dpi[0]} dpi")
The most common applications of InDesign scripts in our work are: importing and mapping styles from Word files, continuous numbering of elements (figures, tables, footnotes) updated after each order change, generating multiple language variants from a single template, exporting to PDF with predefined settings for individual printing houses. Each of these scripts was created because in a specific project a given operation was repeated dozens of times.
Outside of InDesign, we use Ghostscript to process and generate PDF files: batch color conversion (RGB to CMYK in hundreds of files), size reduction, merging documents, extraction of selected pages intended for further processing. PyMuPDF allows us to analyze the structure of finished documents: compare versions revision by revision, extract text while preserving its position on the page, generate summaries of differences. These are tools that complement the process where InDesign's role ends.
# Compare two PDF versions
import fitz
old = fitz.open("report_v1.pdf")
new = fitz.open("report_v2.pdf")
for i in range(len(old)):
t1 = old[i].get_text("blocks")
t2 = new[i].get_text("blocks")
if t1 != t2:
print(f"Page {i+1}: change")
# RGB→CMYK conversion + size reduction
gs \
-dBATCH -dNOPAUSE -q \
-sDEVICE=pdfwrite \
-sColorConversionStrategy=CMYK \
-dCompatibilityLevel=1.4 \
-dPDFSETTINGS=/prepress \
-sOutputFile=out_cmyk.pdf \
input_rgb.pdf
Product catalogs and price lists are the perfect case for automation: a repetitive page layout, data stored in spreadsheets or databases, regular updates. We build systems in which the operator prepares an Excel file with data (names, descriptions, prices, paths to photos), runs a script, and receives a ready InDesign document with all pages, properly formatted tables, and embedded graphics. Changing prices or adding products is a matter of editing the spreadsheet and running the script again.
Cyclic report templates work similarly. Quarterly data goes into a spreadsheet, the script generates a new edition of the report with current numbers, charts, and comparison tables. Work that used to take two days now closes in an hour dedicated to verification and minor typographic corrections.
GREP in InDesign is a powerful tool, but its capabilities multiply when combined with scripts. Instead of a single search and replace, a script can perform a sequence of dozens of GREP operations in a specific order: first clean the text of unnecessary spaces and enters, then apply typographic corrections (conjunctions, dashes, quotes), and finally mark elements requiring the operator's attention.
We create libraries of GREP expressions adapted to the specifics of Polish typography: handling conjunctions, hyphens and dashes, typographical quotes, abbreviations (e.g., m.in., np., tj., dr, prof.), dates, and numbers with thousands separators. One "run cleaning script" operation replaces over a dozen manual document searches.
// GREP sequence: Polish typography
var rules = [
["\\s([aiouwzAIOUWZ])\\s"," $1~S"],
["(\\d)\\s(\\d{3})", "$1~<$2"],
["(\\s)\"(\\w)", "$1\u201E$2"],
["(\\w)\"(\\s)", "$1\u201D$2"],
["(\\w)-(\\w)", "$1\u2013$2"]
];
for (var i=0; i<rules.length; i++) {
app.findGrepPreferences.findWhat =
rules[i][0];
app.changeGrepPreferences.changeTo =
rules[i][1];
doc.changeGrep();
}
# Generating XML for data merge
import pandas as pd
from lxml import etree
df = pd.read_excel("products.xlsx")
root = etree.Element("catalog")
for _, row in df.iterrows():
item = etree.SubElement(root, "product")
etree.SubElement(item, "name"
).text = row["name"]
etree.SubElement(item, "price"
).text = f'{row["price"]:.2f} PLN'
etree.SubElement(item, "image"
).text = row["jpg_file"]
etree.ElementTree(root).write(
"catalog.xml", encoding="utf-8")
We talk about the current way of working: what publications are created, where the data comes from, how long the production cycle takes, what is repeated, where errors appear. Based on this, we point out elements for automation.
We describe the architecture: what will be an InDesign script, what will be an external tool, what the input files will look like, what the output format will be. We determine whether a user interface is needed or if launching from the command line is enough.
We write the code, test it on the client's materials, and iterate. We deliver a solution with documentation and a user manual. We conduct training if the tool is to be operated independently.
After implementation, we support users: we fix bugs reported in production, expand scripts with new cases, adapt them to InDesign updates or changes in the source data format.
Multilingual publications are a special case where automation brings the greatest savings. Scripts can generate language variants of a document based on a single template and a set of translations in a spreadsheet. The system takes into account differences in text length between languages, applies appropriate typographic rules (different word hyphenation, different quotes, different conjunction rules) and exports separate PDF files for each language version.
We have worked with publications in over a dozen languages simultaneously: corporate reports, product manuals, catalogs with descriptions in six versions. Without automation, each variant would require separate manual typesetting. With scripts: one launch, over a dozen ready documents for verification.
The IDML file is an open Adobe InDesign format in which the entire document is saved as a set of XML files packed in a ZIP archive. Therefore, the content of the publication can be processed programmatically: the script unpacks the archive, parses the XML structure, replaces texts, updates paths to graphics, or modifies style attributes, and then packs the file back into an IDML ready to be opened in InDesign. We use this method when generating language variants, replacing data in catalogs, and mass-updating content in template documents.
# Text replacement in an IDML file
from zipfile import ZipFile
from lxml import etree
translations = {"Wprowadzenie": "Introduction", ...}
with ZipFile("catalog.idml", "r") as src:
with ZipFile("catalog-en.idml", "w") as out:
for name in src.namelist():
data = src.read(name)
if name.startswith("Stories/"):
tree = etree.fromstring(data)
for node in tree.iter("Content"):
if node.text in translations:
node.text = translations[node.text]
data = etree.tostring(tree)
out.writestr(name, data)
# Updating prices in IDML files
$csv = Import-Csv "prices-2025.csv" -Delimiter ";"
$map = @{}
$csv | ForEach-Object { $map[$_.sku] = $_.price }
Get-ChildItem "*.idml" | ForEach-Object {
$tmp = "$($_.BaseName)_tmp"
Expand-Archive $_ $tmp
Get-ChildItem "$tmp\Stories\*.xml" |
ForEach-Object {
[xml]$x = Get-Content $_
$x.SelectNodes("//Content") |
Where-Object { $map[$_.InnerText] } |
ForEach-Object {
$_.InnerText = $map[$_.InnerText]
}
$x.Save($_.FullName)
}
Compress-Archive "$tmp\*" $_ -Force
Remove-Item $tmp -Recurse
}
We design publication layouts for a wide range of editorial formats, primarily for trade and industry magazines. Our portfolio includes over twenty published titles, each prepared with meticulous attention to the specifics of its subject matter.
We create beautifully typeset books that are a pleasure to read. We specialize in the design and layout of complex academic, legal, and industry publications containing tables, charts, diagrams, and mathematical formulas.
Professional typesetting of books, magazines, catalogues, and reports in Adobe InDesign. Text layout, table and chart formatting, technical editing, and prepress file preparation. We specialize in publications with complex typographic structures.
Our team includes experienced editors and meticulous proofreaders — the most attentive readers a text can have. Their linguistic sensitivity and exceptional thoroughness ensure every publication receives the highest standard of editorial care.
We create engaging reports that influence business decisions: from concise one-pagers to comprehensive analyses. We select the appropriate format for the specific content and audience needs. We combine solid research methodology with clear visual presentation.
We typeset doctoral dissertations, habilitation monographs, and academic books for publication. We perform technical editing: from unifying structure and footnotes to typesetting tables, charts, and mathematical formulas, in accordance with publisher and university requirements.
We know which questions to ask to arrive at distinctive and functional typographic solutions — for large corporations and small businesses alike, wherever the right typeface choice makes a measurable difference.
We support developers, especially front-end developers. We design and program responsive and interactive website typography along with accessibility principles. We create HTML, CSS, and JavaScript code compliant with specifications.
We provide Adobe Creative Cloud training for companies and institutions, combined with typography and design principles. We also conduct UX audits and expert usability analyses of online products and printed publications.
Virtually anything that can be described by a rule: applying styles, importing and formatting tables, numbering, generating tables of contents, processing graphics, exporting to multiple formats, typographic control (widows, orphans, conjunctions). If an operation is repetitive, it can be saved as a script.
Yes. We deliver scripts as .jsx (ExtendScript) or .idjs (UXP) files, which are installed in the InDesign Scripts folder. They work on Windows and macOS. We include installation and launch instructions.
The cost depends on the complexity. A simple script automating a single operation takes a few hours of work. An extensive batch processing system with a user interface and error handling is a multi-day project. We provide a free estimate after you describe the task.
It will not replace them, but it will relieve them of mechanical work. Scripts take over repetitive tasks: data import, applying formatting, consistency checks. The operator can focus on typographic decisions that require visual evaluation and experience.
Yes. We carry out both one-off assignments (a specific script solving a specific problem) and long-term projects automating the entire publishing process. We do not require a subscription or a permanent contract.
We write InDesign scripts in ExtendScript (JavaScript ES3) and UXP (modern JavaScript). We create supporting tools in Python and PowerShell. For processing XML and structural data, we use XSLT. We match the technology to the task.
kontakt@typograficznie.pl +48 608 271 665
Marcin Szewczyk-Wilgan → ¶
Wrocław, Poland
Tax ID (NIP): PL6391758393