Copy link to clipboard
Copied
I am trying to change paragraph styles in a large document with a GREP search. The code works when I use the CHANGE function, but when I click CHANGE ALL it applies all of my changes except the paragraph style. Does anyone know what might be upsetting the GREP search?
Copy link to clipboard
Copied
Hi @Cal26021403g9p3,
Thank you for reaching out. Would you mind checking this article: https://helpx.adobe.com/indesign/using/find-change.html#search_using_grep_expressions, and also check the examples of GREP searches that might help you?
I am also keeping the discussion open for our experts, who might have more suggestions for you.
Thanks,
Harshika
Copy link to clipboard
Copied
What is the GREP search? Can you screenshot your FC window?
Copy link to clipboard
Copied
Copy link to clipboard
Copied
It also works for me with exactly the same result as for you.
But I have a few questions:
Sorry. But neither the GREP nor the replacement with the styles make sense to me. Can you please show screenshots of the text before and after the replacement? Maybe pictures are a bit more self-explanatory.
^(\u+)\r
do the same for you with FIND/CHANGE?
Copy link to clipboard
Copied
… Can you please show screenshots of the text before and after the replacement? Maybe pictures are a bit more self-explanatory.
- Why replace with a character style AND a paragraph style?
…
By @pixxxelschubser
Please show screenshots or upload a sample file without confidential data but with all styles for testing and link it here. Without seeing the final formatting, it is pointless to continue.
But really, all you need to do is replace the line break after several capital letters with a period+space. The paragraph style does the rest. However, different paragraph styles of the paragraphs to be merged can be exactly the problem with replace all.
Copy link to clipboard
Copied
I too am intrigued: Find paragraphs that consist of two or more upper-case letters and which are followed by a return character. Apply a paragraph style and a character style to that paragraph and replace the return character with a period. (This would ignore the last paragraph if it's not followed by a return character.)
Why not use a single paragraph style for this? That doesn't anser why your query doesn't work, but may enable you to get what you want.
Copy link to clipboard
Copied
Hi Peter,
I was already afraid that I was the only one who thought that way.
😉
Copy link to clipboard
Copied
I'm reformatting a script. Basically, going from text that looks like:
JOHNNY
Oh no
To text that looks like:
JOHNNY. Oh no
And I can't use a single paragraph style because I'm working for an organization with a template that has preexisting paragraph/character styles. Working on convincing them to update things, but until then, these are the parameters I'm working with.
Copy link to clipboard
Copied
It's a strange case. I think the problem is that InDesign gets confused because you change the number of paragraphs while Change All' is executed (you halve the number of paragraphs). There is a workaround, however: do it with two queries.
The first query is like the one you have now. You could remove the paragraph style from the Change Format panel to make the query more efficient, but in principle it doesn't matter much. Similarly, you could remove the $ from the Find What entry because it doesn't do anything.
After executing this first query you have speaker and utterance in one paragraph and the character style is applied to the speakers. Now run a second query that applies the paragraph style to all instances of the character style: leave the Find What and Change To fields empty, set the Find Format panel to the character style (nothing else), and set the Change Format panel to the paragraph style.
That's two queries, but you can use a query runner script to run them together. The simplest one (I think) is this one:
https://creativepro.com/files/kahrel/indesign/grep_query_runner.html
P.