Thanks for coming to InDesignSecrets.com, the world's #1 resource for all things InDesign!

Creating InDesign Scripts With Python

We publish a lot of content related to InDesign scripts here at InDesignSecrets and in InDesign Magazine. And until now, nearly all the scripts we’ve written about were produced with either AppleScript or JavaScript. But recently it was brought to our attention by a developer named Lohrii Alo, that Windows users can also use Python to script InDesign. Lohrii has posted some sample scripts and an introductory article about using Python to script InDesign at Github. One of his examples shows how to use InDesign Server to create a web application that makes business cards.

Another example of using Python to manipulate InDesign is SimpleIDML, a Python library used by the French newspaper Le Figaro as part of an automated system to produce complex documents from components made of IDML (InDesign Markup Language) XML files. It’s certainly not for beginners, but it is an interesting example of how Python is being used in the real world to make InDesign files.

We’ll keep an eye out for more developments in the world of Python scripting related to InDesign!

 

Mike Rankin

Mike Rankin

Editor in Chief of InDesignSecrets.com, InDesign Magazine, and CreativePro.com. Author of lynda.com courses on InDesign and Illustrator. Husband. Dad. Dog walker.
Mike Rankin

Latest posts by Mike Rankin (see all)

  • - November 30, -0001
Tags
Related Articles
Comments

11 Comments on “Creating InDesign Scripts With Python

  1. Lohrii’s Windows solution is awesome, but I’m wishing dearly for the Mac equivalent. And a straightforward way to run the Python scripts from within InDesign itself. (I haven’t tried but it can probably be scripted in JS.) Should we add a UserVoice request for a full integration of Python into InDesign? The language has SEVERAL advantages over both JavaScript and AppleScript! Top of my list: it’s far easier to learn. (And after writing a few scripts: it has collections! dictionaries! lambda functions! a MASSIVE set of VERY useful libraries! of which the majority is FREE!)

  2. I like this topic, though I don’t know much about using scripts or writing them. I am the person charged with making our non-profit’s membership roster for 2018-2020. So I have thought that using a script to format the text that includes an image of each person, their name, address, phone, email, yr joined, spouses name… I’d bring in the data from a thumb drive that the previous roster person made, but I’m a bit stumped on where to begin this journey. Any assistance would be greatly appreciated.

    Should the data I’m importing be saved in a certain format? Are there free scripts for doing this? Can I set the type style? Size?

    Thank you.

    • Do you really want such an extensive answer in these (small!) comment boxes? (Your question is also not really about Python, is it?) Better ask in the General Questions Forum. Follow the link in the top bar to the forums.

    • @KaCe No need for scripting. You can probably use Data Merge. Read the help files, or get a subscription to lynda.com (free trial!) and watch David Blatner’s “InDesign: Data merge and database publishing course.

      • Thank you for the information. I will get a Lynda.com subscription and will glean all I can from David Blatner’s merge and database publishing… it gives me a direction to head. I also can’t believe that I’m the only one who volunteers to do these things and then must figure it out. Your direction will give me a good start. Thanks again.

Leave a Reply

Your email address will not be published. Required fields are marked *