Back

If your email is not recognized and you believe it should be, please contact us.

  • You must be logged in to reply to this topic.Login

Jongware: Your Preptext.jsx script breaks in 5.5?

Return to Member Forum

  • Author
    Posts
    • #60469

      Hi there, and I hope our wonderful IDS member Jongware sees this and is not on vacation or anything…

      Jongware, I use your preptext.jsx script quite a bit in my EPUB workflow but it's not working right in CS5.5.

      The problem is that it creates and applies character styles to text that is already styled properly because of the paragraph style definition. For example, if my Headline para style is Bold Helvetica, running preptext will create a Bold character style and apply it to all the text in the headline. I'm pretty sure it used to *ignore* that, and only act on locally overridden text.

      For an EPUB workflow, this makes using the script unworkable because of the horrendousness :D of the tags ID applies to these double-hit paragraphs; you get both the <p> class assigned to the whole thing and also a <span> char class applied:

      <p class=”Heading2″><span class=”Bold—Scaps”>Preface</span></p>

      Interestingly, it is smart enough to ignore nested styles; as far as I can tell, but it double-hits GREP styles too. If I added a GREP style to automatically make the word “Roman” appear in bold italic (and named my character style roman-ital), the script creates and applies a Bold-Italic character style to it. When you export to EPUB, the text with the double-hit has both span tags applied:

      past, to its <span class=”Bold-Italic roman-ital”>Roman</span> foundations and

      I show people how to use your preptext.jsx script in all my Lynda.com videos on ID>EPUB, and :: sigh :: didn't notice how it messed up 5.5 files, I guess. So it's unusable for this purpose.

      :: whine whine::: can you fix it? Even if it would require people to pay for the script, it'd be worth it, let me tell you.

      AM

    • #60470

      In case people aren't familiar with Jongware's Preptext.jsx script, it's a cross-platform script that goes through an InDesign file and when it finds overridden text (like bolded words or italicized words), it creates a character style and applies the style to the word. It's a miracle worker!

      Here's a screen shot of a typical problem child bit of text:

      In the middle of the paragraph, the words “Despite” and “cultural” are examples of overridden text.

      You can download the IDML version of the above (comes with all the paragraph and nested styles you see applied) if you want to test it for yourself here:

      https://dl.dropbox.com/u/783863&#8230;..t.idml.zip

      AM

    • #60471

      Hi Anne-Marie! No, no vacation for me — I've bin a bit quiet lately for the very opposite of that, alas.

      I don't think the script is broken. Mind, I developed preptext primarily for fixating First Import of Word text; and, typically, headings and such wouldn't have been marked up yet with bold or italics. Every now & then an author does so manually, and if I see it in time I remove the spurious formatting before prepping the entire document.

      In your case, your text is already formatted as-it-should, but preptext doesn't “know” that the boldness in your headings is due to the paragraph style and thus marks it “again” as a character style. It might be possible to make it “paragraph style-aware”, just as it's already “character style-aware”, but I need to look into it.

      Interestingly, it is smart enough to ignore nested styles; as far as I can tell, but it double-hits GREP styles too.

      Now there's a puzzler. If I had to guess I'd say either both or none …

    • #60487

      So … “I need to look into it” means when your workload lets up, I'm guessing :-(

      Thanks for the quick reply, anyway. I could've sworn it *didn't* do that in previous iterations, but obviously I was wrong. Hmm.

      AM

    • #61161

      I had the same experience as Anne-Marie. I had a paragraph style with All Caps as part of the style settings. I applied the style to a lowercase paragraph to turn it into all caps, with no local formatting or character style, i.e., no + sign next to the paragraph name.

      But when I ran preptext.jsx (Mar 30, 2010 10:41 PM version), it decoupled the all caps relationship from the paragraph style, created a Caps character style and applied to it.

      When I deleted the character style and replaced with none, and preserve formatting, the paragraph showed up as one with Text Overrides (local formatting) in Marc Autret’s ShowHideLocalFormatting.js and In-Tools’ ShowTextOverrides.jsx because now the attribute had been decoupled from the paragraph style, and the character style was deleted.

      The so-called override attribute is exactly the same attribute in the paragraph style, and therefore, the + sign did not show up next to the name. To remove the “override,” I had to option-click on the paragraph style.

      In a somewhat related matter, I tried PreserveLocalFormatting.jsx, but apparently it doesn't even work in CS 4: https://forums.adobe.com/thread/429756

      Many scripts seem to be behind InDesign updates. I can't complain because they are free. But it would be great if script developers catch up soon.

    • #61163

      But when I ran preptext.jsx (Mar 30, 2010 10:41 PM version), it decoupled the all caps relationship from the paragraph style, created a Caps character style and applied to it.

      That's the correct, and expected, behavior. As I noted before, preptext is not designed to work 'afterwards'. It searches for a character attribute that does not have a character style applied to it — so if your formatting (in bold, caps, underline or whatsit) is defined in the Paragraph style, rather than as plain applied formatting, it will pick up this as well.

      Many scripts seem to be behind InDesign updates. I can't complain because they are free. But it would be great if script developers catch up soon.

      I wrote preptext to preprocess freshly imported formatted Word files. Using it for any other purpose is at your own risk.

    • #61164

      That said, personally I don't see why you have to run preptext at all, right before you save as ePub.

      Before I export an InDesign file to ePub, I make sure any and all local formatting is either removed (in the case of ad-hoc fixes) or is appleid through a character style. “Real” formatting such as bold, italics, and capitals should already be saved as character styles, as it's practically the very first thing I do after loading a new file.

    • #61707

      I'll be writing a blog post about this shortly (and I discuss it in Podcast 167) but I wanted to mention that Peter Kahrel helped me out w/a project by writing an “add-on” to preptext.jsx, which I've called “PerfectPrepText.jsx.”

      Download PerfectPrepText.zip

      It's for working around the problem I originally posted at the top, that is, for running on InDesign-styled text that has local formatting you want preptext to affect (but not affect already-styled text). It requires preptext.jsx but before running it, it “neutralizes” applied styles, runs preptext, then re-constitutes the styles.

      The Zip file comes with a couple permutations that I hope to explain (if not self-explanatory) in a post.

Viewing 7 reply threads
  • The forum ‘General InDesign Topics (CLOSED)’ is closed to new topics and replies.
Forum Ads