5

I had a catalog layout with 200 captions. They all have the same distinctive character style. I am searching for a solution to export only these caption texts with the distinct character style out of InDesign in a new document as for example, an RTF text. The format doesn't matter. It's more important to have only the captions out of the whole catalog.

0

2 Answers 2

3

Edit: Even though you seem to mention it multiple times, it just dawned on me that you were talking about character styles and not paragraph styles... :(

I'm just going to leave this here anyways.


You could do this with table of contents.

You can make table contents by using paragraph styles as the "hook".

Layout > Table of contents...

Here I pretty much touched only those options that I've explained in the image.

Click here for a bigger image enter image description here

...and when you click OK, it will create me a nice list of all the text with the specified "yay" paragraph style in it:

enter image description here

The rest should be simple.


If you make text changes to your document, you can update the TOC by first selecting the table of contents text block and then selecting Layout > Update table of contents...

2

Here's a method that works and doesn't require anything other than basic InDesign features.

It's pretty easy, but has a few steps, so, if you need to do this often, it might be worth looking into using scripts instead (see comments below) so you can do all of this with one click, not many.

1: In a copy of the file, remove all text that doesn't have this character style

  1. Save a copy of the indesign file. We're going to make a mess of this file and you don't want to accidentally save over the real InDesign document.
  2. Delete every character style in the character styles list except the one you're interested in. It'll ask you what to replace each one with. Replace each one with [none].
  3. Open the Edit > Find/Change window (ctrl-f). Switch to 'GREP'
  4. In the Find what: box, enter .* (this will match everything). Leave 'Change to:' blank.
  5. In Find formats, under Character Style, choose [none].
  6. Hit Change all. Everything should be instantly deleted except the text in that one remaining character style.

2: Copy all the remaining text from this indesign file

Export as HTML and copy from there.

  1. File > Export
  2. Choose the format to be HTML. Save this HTML file somewhere.
  3. Open it up in a browser. It'll be a hideous monstrosity to look at - this doesn't matter.
  4. Select all (normally ctrl-A). Copy.
  5. Paste into a plain text editor: e.g. Notepad if you're on Windows, or if you're on a Mac, Textedit after using Format > Make Plain Text. This scrubs out all images and formatting, leaving just the text.  6. Delete that hideous HTML page before anyone sees it...
  6. Tidy up the text as needed - e.g. you'll probably want to find & replace away unwanted paragraph breaks.

3: Profit

7
  • Following the same principal, it would be relatively simple to set up a script that grabs text spans based on character style and dumps it all into a frame somewhere in the doc or in another open doc. Then you wouldn't have to bother modifying the source. Apr 26, 2013 at 17:30
  • If you can make such a script that would be a good answer. Personally I never know where to start with adobe scripting, the docs are pretty overwhelming. This method works and doesn't takxe particularly long. Apr 27, 2013 at 1:38
  • I'd have to dig back into some of my old scripts for reference but S&R routines are quite easy to set up. You wouldn't even need grep, just the character style name. Apr 27, 2013 at 8:39
  • @plainclothes This script seems to come rather close to what the OP is asking hubbers.info/content/…
    – Joonas
    Apr 27, 2013 at 9:26
  • 1
    That works fine for me – thank you very much. I just had to delete all the pictures (using this script here: link before exporting the text to html.
    – user12352
    May 3, 2013 at 6:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.