Mobile app version of vmapp.org
Login or Join
Merenda852

: Convert paragraphs to specific style based on content? I really like plain text writers, such as Ulysses and the recently found Bear (both Mac). I'm currently writing my thesis and I enjoy styling.

@Merenda852

Posted in: #AdobeIndesign #IndesignScripting

I really like plain text writers, such as Ulysses and the recently found Bear (both Mac). I'm currently writing my thesis and I enjoy styling. However, something that really annoys me is the gap between a plain text writer and InDesign. I can't easily copy over text from a simple writer to InDesign. So I'm looking for a way to minimise that gap.

I noticed that Bear, for example, uses Markdown as an output. If you copy header-1 (i.e. "This is a header") text to InDesign that paragraph will be output like "# This is a header". When you have a header-2 it adds 2 '#' in front and quotes obtain a '>' in front of the paragraph.

With that discovery I was thinking of automatically convert each paragraph to a specific style based on a ruleset, depending on the first character of a sentence.

if rule starts with "#" then apply paragraph style "header-1".


Additionally, that hashtag should be removed, but that could be done with a find & replace (find "# " and replace with "").

But uh.. Is it possible to apply paragraph styles based on certain rules? Preferably automating this thing?

10.03% popularity Vote Up Vote Down


Login to follow query

More posts by @Merenda852

3 Comments

Sorted by latest first Latest Oldest Best

 

@Hamaas979

You can also use pandoc to generate an ICML file (the native file format of Adobe InCopy), which you can "place" in InDesign (File > Place).

pandoc input.md -s -o output.icml


Use Edit > InCopy > Check Out to edit the imported text in InDesign (see managed files).

10% popularity Vote Up Vote Down


 

@Margaret771

Just want to expand on @Mario Breskic's response a bit. The scripts that are mentioned on the page that he linked to are based on InDesign's GREP and Nested Styles features. Although I am not very good with GREP in general, and so haven't used the GREP styles very often, I highly recommend learning how to use both Nested Styles and GREP styles in InDesign, because they are like magic when it comes to automating paragraph styling. My favorite resource for InDesign support is InDesign Secrets: GREP Styles and Nested Styles.

10% popularity Vote Up Vote Down


 

@Gonzalez368

Do you mean like Markdown to InDesign does? (skip the Word part)

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme