Script-apply bullet points to one line of story but not to another

Learn / Forums / InDesign Add-ons (Scripts, Scripting, and Plug-ins) / Script-apply bullet points to one line of story but not to another

Viewing 3 reply threads
  • Author
    Posts
    • #95603
      A Zook
      Member

      Specs: Indesign CC 2015, Win10

      Problem: In a large doc we’re working on, we have stories/text frames with text that comes with double hard carriage returns (empty paragraph/lines) to separate the story into chunks of lines. The paragraph style uses bullets and so the story has bullets followed by text and bullets with no text following… kind of like this: (and each story ends with two carriage returns)
      > some text blah blah
      > some text blah blah
      >
      > some some more text blah blah…
      >
      >

      Desired Outcome: Visibly remove the bullet points from only empty lines.

      Caveats before someone chimes in with… “remove hard carriage returns using GREP, Find/Change or script…
      1. This text is coming from out-of-doc data source that Must include the hard returns. But the data overall is dynamic and changes periodically and so we update our doc’s text with this data containing these hard returns. So any local removing of the hard returns, changing them to soft returns, etc is pointless because as soon as we run an update, they’re back…with a bullet point.
      2. I do have a GREP code that I can use in a Find/Change that finds every empty paragraph line in a story and I can go through the doc and Find Next and Change the bullet points away… For some reason, Change All does not do them all in one shot. As you might imagine this is tedious and not the efficient, one button way we would prefer.
      3. It’s my understanding that Paragraphs Styles > GREP Styles can’t address this problem because those use only Character Styles to make changes and a character style cannot address my bullets… ? (I wish it could, because then I wouldn’t be here trying to explain this problem…but if anyone has a solution in this vein, please let me know!)

      Possible solution?
      I believe this is where we need a script. So far, I’ve found online discussion of code that uses lines like this, app.findGrepPreferences.findWhat… etc.
      I’ve even worked up a script with parts that seem to work, but not all. Such as

      app.findGrepPreferences = app.changeGrepPreferences=null;
      app.findGrepPreferences.findWhat = “(?<=~b)$”;
      app.findGrepPreferences.appliedParagraphStyle = “Fineline Description”;

      And I can even see something being captured by using this:
      var myFinelineDescriptionParas = app.activeDocument.findGrep();
      alert (myFinelineDescriptionParas); // gives a list of all the empty paragraphs with said paragraph style for the whole doc

      But when I add the rest of what I’ve seen suggested… like this: Nothing happens. Nothing changes.
      app.changeGrepPreferences.appliedParagraphStyle = “Fineline Description – No Bullet”;
      app.activeDocument.changeGrep();

      Obviously I’m missing something or not going about it correctly in the script. Do I need to loop through the doc? Reference, gather (via var…=) more things from the DOM?

      I appreciate any suggestions or questions if you need clarification.
      Thanks

    • #95621

      This can’t be answered correct, without seeing a document and there is also more information needed. You can contact me outside the forum at: [email protected]

      Kai

    • #95645

      Just for comment!

      In a simple case, just one para style => when blank paras, no visible bullet!

      Visible/Invisible Bullets

      (^/)

      • #95695
        A Zook
        Member

        Obi-wan Kenobi, I’m not sure what you mean by this… I know that I can manually apply different para styles to different paragraphs within a story to make one line have bullet points and another not. But that’s a long and tedious way to address multiple stories throughout a 600pg catalog. I’m looking for a way to automate, as much as possible, this task. I would love for it to be fully automatic (like a paragraph GREP style…). I’m not sure how your suggestion helps me do that?

    • #95794

      I’ve just applied the same para style to all the text!
      When the para is just a blank line (with a single hard-return), the bullet is simply … invisible! Magic! =D

      (^/)

Viewing 3 reply threads
  • You must be logged in to reply to this topic.
>