Copy link to clipboard
Copied
Working in a book, I fail to apply "then next style" to the paragraphs after titles. So now the have the same style as the rest of the normal text, that is, a style named "normal text". Now I need to apply the "text after title" style to all the first paragraphs after the style "title".
In short(er), I need GREP to look behind any next paragraph after "title" style and apply "text after title" style to it.
I've done it before, but I have lost my super powers.
Can you help me?
Thanks!
Seb
Copy link to clipboard
Copied
In this thread you can find interesting script, fixing paragraph style combinations.
Copy link to clipboard
Copied
Thanks winterm, but I'm sure we don't need scripting for this. The secon part of the post you mention looks like it could ansewr my question, but since I don't fully understand the grep code they are using, I can't adapt it to my needs.
I'll take a deeper look at it anyway.
Thanks again!
Copy link to clipboard
Copied
You're welcome.
That script is ready to use, intuitive, and requires no special knowledge. Easy.
If you want more semi-manual control, GREP is the way to go.
Obi-wan gave excellent samples there in that thread, regex he used are pretty simple to understand. He covered your question fully, I believe.
There's a lot of GREP code sheets floating around on the net. Do yourself a favor, download one or two of them.
Also consider a tiny bit outdated but still excellent Jongware's script WhatTheGREP (google for it). It's a tool to explain given GREP expression.
Copy link to clipboard
Copied
yep, that script looks like the way to go. but the link seems to be broken.
Or is it that that long code is the script?
I'm not sure into wich kind of file should I copy it.
Copy link to clipboard
Copied
Read the very first line in 'Correct Answer': Link lost!
That's why Obi reposted it.
Yes, you should copy the whole code from the beginning right after the screenshot, save it in a plain text editor as *.jsx file and place that jsx file in your Scripts panel.
Copy link to clipboard
Copied
yes yes I read that. Sorry for being redundant
It worked. Thanks a lot.
I should note, though, that it doesn't work when the styles are in subfolders, since it result in the name being to wide for the script menu list. Of course it can be easily fix getting those styles out of the folder.
Thank you winterm!
Copy link to clipboard
Copied
You mean your styles are in style folders? If that's the case, I just saw a script the other day that pulls all the styles out of their style folders for you. Let me know if that would be handy and I'll see if I can track it down. And glad the other script worked for you!