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
Tagged: bullet points, find/change, paragraph styles
- This topic has 4 replies, 3 voices, and was last updated 6 years, 9 months ago by Michel Allio for FRIdNGE.
-
AuthorPosts
-
-
June 21, 2017 at 8:46 am #95603A ZookMember
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 asapp.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 docBut 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 -
June 22, 2017 at 12:03 pm #95621Kai RübsamenMember
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
-
June 24, 2017 at 4:57 am #95645Michel Allio for FRIdNGEParticipant
Just for comment!
In a simple case, just one para style => when blank paras, no visible bullet!
(^/)
-
June 27, 2017 at 6:17 am #95695A ZookMember
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?
-
-
July 1, 2017 at 3:51 am #95794Michel Allio for FRIdNGEParticipant
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(^/)
-
-
AuthorPosts
- You must be logged in to reply to this topic.