I don't know about doing this with GREP, but there is a very straightforward way to do it with just the Paragraph Styles themselves. Add the appropriate Next Style attribute in each defined style. Then all you have to do is select all the text, right click on the first style and choose Apply "style name", then next style.
that's not the answer - you cannot select the entire story and apply the next style option this way as it will not locate styles i have applied to the chapter titles and run the next style command accordingly. it will jsut remove the styles applied to the chapter titles. what you are suggesting is i select each chapter one by one which kinda defeats the object
Ariel, your response was blank...
Thanks Peter. It's as irritating for me as it is for you.
GREPing for next style can't really be done conveniently.
What the OP is looking for is something like this:
SJRiegel: If you've got a long book with many chapters, applying next style to all those chapters can be quite a hassle (although my free "quick apply with next style" script makes it easier: Quick Apply with Next Style (Free Script!) | FreelanceBookDesign.com)!
No you can't do it with GREP styles.
That's the answer.
That's brilliant Ariel - thanks for taking the time to write such a useful script!
thanks for the script - i will take a look.
actually, like i mention, i did get it to work using GREP !
bit long winded but played about until i had an expression that found the last few letters of the chapter titles followed by the first letter of the first paragraph. i then used the change to option by adding a section marker after the first letter - quite simple really! then i told GREP to find the markers and apply the chosen style... then did a find change to remove the markers :-)
took a couple of mins but did the job.
Thanks, it is a useful script, which has been available since 2012! Really, Adobe should include a Next Style option in their own Quick Apply! Seems like an obvious omission.
Yup, it is possible (though you have to do it as a two-step process) -- but it's a hassle!
I styled a 3,200 page book in 4 hours using GREP, including alternating running heads (4 different running heads changing per spread)
I know it can be done - but for a lot of people the process is too complicated - but alas you found your own way of handling it.
Sorry but the script you have provided, although I can see the benefits, does not answer my question.
This script still relies on selecting the paragraphs you wish to apply the next style to.
this is what i want to do:
automatically apply the next style to ALL the chapter headers.
lets say the chapter headers have a style called CHAPTER HEADERS. now, also i have two other paragraph styles, one called BODY and one called BODY DROP CAP. The entire story, apart from the chapter headers, have BODY applied. I want to be able to locate all the chapter headers by their style and make the lead paragraph have the BODY DROP CAP style. I can't select the entire story to do this - your script relies on making a selection. This is why i hoping someone knew a GREP expression that could locate the CHAPTER HEADER style and just run the next style option on it.
I was trying to think logically like nested styles - apply style - run through 1 paragraph type of thing. The next style option is very limited. Asking to run sequential styles down paragraphs doesn't seem a big ask.
The first script I linked to does exactly what you need (it's not free, but not expensive either):
There is a free demo on that page to download, that let's you use it 3 times -- so maybe it could be a solution for you!
It's not finished but I've tested its last version here as:
1/ you mark the "blue" paras:
2/ Then you mark the two paras that follows:
3/ You launch Kai's [JS]. An UI appears. You enter your settings [The last option does not actually work well // little bug]:
ok cool. i will definitely take a look at this.
thank you so much :-)
But this method still seems to require me to mark each paragraph - if i have to do that then i may as well just change it manually. if my doc is 300 pages long and already has 25 chapters with styles applied to the chapter titles then i don't want to have to go through and change the lead paragraph one by one. Ariel's script i think will do the job as required. thank you anyway.
Not at all!
I use Multi-Find/Change [absolutely essential tool for any user of InDesign].
Which means that I treat the issue in 2 clicks (1 click for the 2 regex ; 1 click to execute the [JS]) or say 1 second per click!
That the document be 10 pages or 1,000 pages, it will still take me two seconds!
Why I prefer this script [even if Ariel's script is excellent and clever] is because It can do other things [in its final version].