Coder Social home page Coder Social logo

printmaster's Introduction

Printmaster

Printmaster is an attempt to automate my writing workflow. I'd like to go from Markdown-formatted plain text to a nicely set InDesign document, all with the press of a button.

Here's the plan

Since Markdown easily formats to HTML, I'm using InDesign's ability to import XML text and apply it to a previously designed InDesign template.

  1. Given a Markdown document,
  2. Convert it into XML
  3. Pass that to an AppleScript file. The AppleScript copies a previously designed and formatted InDesign template, imports the XML into the template, and maps the template's styles to the tags.
  4. The AppleScript exports this all as an InDesign document.

Requirements and Use

I have CS4. If this works with any other version, let me know.

Open up Printmaster.scpt in the AppleScript editor and change the paths. There are two: one for your template file (I've included a sample file) and another for your source.

Run the applescript file and InDesign should open and create a new doc for you. Drag the XML from the sidebar over to the page, and your markdown text will propagate. This works best if you've set up your template's master pages in any sane way.

Source File

The source file needs to be XML in order for InDesign to work with it. For my example, I exported a markdown file to HTML and used only what was within the <body>. I wrapped that within a <root> tag and put an XML declaration on top. The goal is to eventually do all of that automatically.

Unit types error

If you are running Snow Leopard, you may see an error about the Adobe Unit Types scripting addition file:

Error loading /Library/ScriptingAdditions/Adobe Unit Types.osax

Apparently, the addition file installed with CS4 is 32-bit, while AppleScript expects 64-bit. There is an Adobe Knowledge Base article on the topic witch lists a number of suggestions to work around the issue, including a 64-bit scripting addition file.

Help

I'm always looking to automate this process further. If you have any interest on taking on the TODOs I've left, please let me know.

Resources

You may be interested in reading up on Adobe's documentation on the topic. This page has a great variety of resources, including user guides and links to the InDesign Scripting User Forum. Who knew.

About

Authored by John Finley, September 2010. Released to the public domain.

printmaster's People

Contributors

jpfinley avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.