Skip to main content
SuzzyFlamingo
Inspiring
May 10, 2025
Question

Dynamic Par styles

  • May 10, 2025
  • 6 replies
  • 1561 views

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 😞

6 replies

TᴀW
Legend
May 11, 2025

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

 

 

id-extras.com | InDesign tools & scripts for typesetters, form designers, and translators
Peter Kahrel
Community Expert
Community Expert
May 11, 2025

Here's a plug-in that implements conditional styling:

 

https://exchange.adobe.com/apps/cc/2e1fb2bc/conditional-styling-rules

SuzzyFlamingo
Inspiring
May 11, 2025

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

leo.r
Community Expert
Community Expert
May 11, 2025
quote

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:

https://www.linkedin.com/posts/vlad-vladila-97174356_indesign-uxp-automation-activity-7303400250617061376-OVFv/

Community Expert
May 11, 2025

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)

 

Robert at ID-Tasker
Legend
May 10, 2025

@SuzzyFlamingo

 

There is no built-in "conditional styling" in the InDesign. 

 

Robert at ID-Tasker
Legend
May 11, 2025

@SuzzyFlamingo

 

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. 

 

jmlevy
Community Expert
Community Expert
May 10, 2025

Are your  paragraphs styled with “Par0” style always followed by a “Par1” paragraph? If yes, just apply a space after to “Par0”

SuzzyFlamingo
Inspiring
May 11, 2025

No.  That is the problem....

BobLevine
Community Expert
Community Expert
May 10, 2025
Why not just make a new style?
SuzzyFlamingo
Inspiring
May 11, 2025

Yes, of course, but I am addicted to elegant automation...