Copy link to clipboard
Copied
Hi, Dear Friends!
I have a paragraph style called "par1". This style has zero indent from the top. How can I make it so that when a paragraph with this style is after a paragraph with the style "Par0", and only then, it has an indent of 7 from the top?
Thank you, and have a good day!
Susan Flamingo
PS ChatGPT choked on this one 😞
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Yes, of course, but I am addicted to elegant automation...
Copy link to clipboard
Copied
Are your paragraphs styled with “Par0” style always followed by a “Par1” paragraph? If yes, just apply a space after to “Par0”
Copy link to clipboard
Copied
No. That is the problem....
Copy link to clipboard
Copied
Copy link to clipboard
Copied
My tool isn't free and maybe not cheap - depends on how much you want to automate - but if you work on Windows, you could sort / filter / include / exclude by:
- page - specific / left / right / range,
- layer - specific / range - part of the name,
- position (x, y) - specific / area / approximate,
- applied Master - specific / range - part of the name,
- text / Cell / Table formatting - 400+ properties each - specific / range,
- applied ObjectStyle to the TextFrame - specific / range - part of the name,
- object's properties - TextFrame the text is in - 1000+ properties - specific / range,
- you're not limited to whole paragraphs - you can mix&match F&C results - so you can search for specific words / phrases,
- if text is in the "main flow" or in a Cell / Table,
- if TextFrame - container - is on the page, pasteboard, part of a group or Anchored / InLined,
- you're not limited to text being in the same text flow - Story,
- you could even mix&match multiple documents if needed,
- and more.
After saving all the "requirements" as a Task - you can load them again to process another file - tomorrow, next month, etc.
Copy link to clipboard
Copied
As @BobLevine points out - use more styles - it's a must for clean document structure.
You're probably too deep into the layout to realise that you've encountered a situation that you want to now fix.
Luckily that's where scripts can work wonders.
All you have to do is create your additional Paragraph Style and then add the names of your paragraph styles to the script
Replace Par 1/Par 0/Par 2 in the quotes with your own style names.
Save the code in a plain text file and change the extension from .txt to .jsx (or grab another srcript and duplicate it and edit it and replace the text in a plain text editor).
This is rudimentary - we could add a trigger to make it run automatically - like a listen event when you Save the Document
var doc = app.activeDocument;
var stories = doc.stories;
for (var s = 0; s < stories.length; s++) {
var paragraphs = stories[s].paragraphs;
for (var i = 1; i < paragraphs.length; i++) {
var thisPara = paragraphs[i];
var prevPara = paragraphs[i - 1];
if (thisPara.appliedParagraphStyle.name == "Par 1" && //insert your style name
prevPara.appliedParagraphStyle.name == "Par 0") { //insert your style name
thisPara.appliedParagraphStyle = doc.paragraphStyles.itemByName("Par 2"); //insert your style name
}
}
}
https://creativepro.com/how-to-install-scripts-in-indesign/
What I'm thinking is that we come up with Scripts to apply your paragraph styles
Then assign Keyboard Shortcuts to your Styles - if you're using hotkeys for Paragraph Styles that's perfect we can replace those Shortcuts to trigger scripts instead.
So if we have script that says you want to assign par1 - the script then triggers.
Let us know if this works for you - automation by scripts is awesome and a huge time saver.
It's just 1 extra style
And we can trigger the application with Keyboard Shortcuts when applying the styles
Or simply saving the file - but that could cause mass text shifts.
So I think running the script once to apply the style as you want it to appear with the extra style will work for you.
Then the we could build other scripts that trigger with keyboard shortcuts to apply the styles.
Are you interested in this?
If you are drop a sample file with your styles and we can take a look at automating this for you.
<EDIT>
Sample file and script attached (change .txt to .jsx)
Copy link to clipboard
Copied
Here's a plug-in that implements conditional styling:
https://exchange.adobe.com/apps/cc/2e1fb2bc/conditional-styling-rules
Copy link to clipboard
Copied
Thank you for your attention!
So I have to pay 25/year for this? What else will you get with a subscription?
Also, what exactly is a PlugiN in the context of ID? I would just run the scripts?
Is there documentation for this that I can review before I commit?
Thank you, and have a good day!
Susan Flamingo
Copy link to clipboard
Copied
Is there documentation for this that I can review before I commit?
By @SuzzyFlamingo
Their website doesn't seem to offer much yet:
It's done by a reputable developer though; you can try to contact him on LinkedIn:
Copy link to clipboard
Copied
You can try the script that I supplied. If you want to enhance it let me know, no prob.
Copy link to clipboard
Copied
Hi Suzzy,
I'm Vlad, the developer of the Conditional Styling Rules plugin. Indeed, my website is under construction (and it looks like it will still be like that for a while), but I'll try to answer your questions here (also, thank you, Peter and Leo).
A plugin in InDesign's context is a piece of software that will provide new capabilities to the base application.
In this case, it means that once the plugin is installed and activated from InDesign's plugins menu, it will show a new panel like all the other "native" tools in InDesign, eg, "Paragraph Styles" panel or "Layers". In this panel, you can create new rules, edit existing ones, delete them, apply, etc.
I tried to keep the UI as self-explanatory as possible.
Clicking on the "+" button will open the dialog to create a new rule.
For your use case, the rule is very simple:
"When "par1" is preceded by "par0" change the properties of the paragraph to add 7pt spacing on top".
Once the rule is defined, you can apply it globally to the document, or just to a part of it, and when applying it will search for all instances of par0 preceded by par1 and change the spacing as defined.
Of course, this is just scratching the surface of the capabilities of the plugin. You can define and apply any number of rules, and in the rule's conditions you can specify any number of styles to provide the context. For example you could create a rule that specifies "if Body_Text is preceded by any Heading style, remove the first line indent", of "if List is not followed by any list style add 10p space after". Once you have a good set of rules, a fairly regular document like a fiction book can be styled automatically just by applying all the rules.
Hope this helps, and I hope you will like the plugin,
Cheers,
Vlad.
PS: I just got a report that the latest InDesign update is causing the plugin to crash in some instances. I'm actively investigating it and hope to have a fix available by tomorrow.
Copy link to clipboard
Copied
Change Consecutive Paragraphs does this (not free):
https://www.id-extras.com/products/change-consecutive-paragraphs/
Documentation:
https://www.id-extras.com/help/changeconsecpro/
It also has a fully batch-editor so you can save and reuse all the settings:
https://www.youtube.com/watch?v=nd4yGJv-l3Y
Find more inspiration, events, and resources on the new Adobe Community
Explore Now