Skip to main content
Inspiring
March 29, 2017
Question

paragraphStyleChanger v2.80

  • March 29, 2017
  • 5 replies
  • 8421 views

Hi,

i wanted to share this indesign script i wrote. I would be happy if people give me feedback. The script finds and applies conditional combinations(!) of paragraph styles comfortably in almost any kind of selection.

 

_____________
DESCRIPTION
This script is good for finding and replacing applied paragraph styles comfortably, especially for finding consecutive combinations of styles. I use it in early design phase to quickly try different typographical layouts and very often to change subheadings or the paragraphs following subheadings.

_____________
SOME EXAMPLES
- Simple case: find each paragraph with style 'X', change it to style 'Y' (less clicks than the find/change-dialog)
- Conditional case: find each occurrance of 'Head followed by Sub' and change it to 'Head2 followed by Sub4'
- Use the 'autoReverse'-setting to compare two style combinations back and forth quickly.
- Use the 'quick test'-setting to do serial runs of layout variations: after a run it will automatically enter your last 'change to'-styles into the 'find'-styles so you can focus on selecting new styles to changeTo with a flick of the mousewheel.  
- The 'get styles'-buttons fetch styles from your selection into the find- or change-dropdowns.
- Set paragraphs to [NO-paragraph-style] in order to break their link to a style temporarily. Later find and reassign [no-style]-paragraphs.
 

The script has a lot of options and use cases that go far beyond what you can with GREP and gotten better over the years, you can use it on almost any kind if nested selection of groups and anchored opjects too.

 

The script comes with 

- internal readme (in the settings, which you SHOULD read at least once).

- English and German

 

 

Download and rename the attached .txt file below to ".jsx". (The forum won't allow the upload of .jsx-files.)

 

cheers,

Stephan Möbius

__________

Edit August 2025: v.2.80 significan bug fixes in event-handling – making the UI  more persistant and stable. Also the option to import older versions settings (your user-queries) from other documents.

 

Edit April 2022: removed source code of paragraphStyleChanger.jsx Version 1.11 (from March2017) from this post to clean up thread, re-attached .1.12-txt-file to this post for continuity. See newest version 2.75 down below.

 

5 replies

Inspiring
August 15, 2025
New Version 2.80 
 
See above and rename paragraphstylechanger2-80.txt to .jsx or download via my Google Drive:
 
CHANGELOG
v2.80 - August 2025 - Fixed: Replaced rescource intensive idleTask with proper eventHandling – palpable performance fix!
v2.79 - February 2025 - New feature: Transfer user queries from other documents. Fixed: EventHandler error when starting script a second time. Prevent reinitialization if script is already running.
v2.78 - February 2025 - Fixed: Causes Indesign to crash when documents use faulty fonts. No longer does risky file-caching of the paragraphStyles-object via toSource/Eval. "Remove script label" now removes all PSC's older labels too. PSC now updates itself when switching documents.
v2.77 - September 2024 - Introduced option to let you import the findChange-Queries from an older skript-version in the currentDocument.
v2.76 - April 2022 - Bugfixes in nested objects
Inspiring
April 23, 2022

v.2.75 - bugfixes for working with more cases of nested objects, anchored textframes, tables in tables, and textpaths in polygons

 

paragaphStyleChanger 2.75, April2022 - https://drive.google.com/file/d/1tfQa7sej8mUAR8Hmsb1U4HyMt-JBuHBD/view?usp=sharing 

 

or rename attached .txt-file to .jsx.

M.Hasanin
Inspiring
August 27, 2022

@Stephan Moebius 

Thanks for your sharing and great efforts, have a nice day

Mohammad Hasanin
Inspiring
February 8, 2022

February 2022: Someone contacted me about this script. I never published my last version of it back in 2018. The last version is "paragraphStyleChanger2-73,jsx" from May 2018. I still use it up to this very day in my job in CC2022 as editorial designer. It has some bugs left – like: sometimes it stops reacting to selection changes in indesign. Closing and restarting the script helps and doesn't hurt. I will never get so deep into programming again to be able to fix it. If you don't trust this download link of the source code from my google Drive take the source code below for copy&pasting. 

 

Download paragraphStyleChanger 2.73 (Google Drive) 
https://drive.google.com/file/d/1HMeA_f2n3sDD6x3ah5xGB5WmuZEuD3ZZ/view


There were a lot of great changes and improvements in 2.73. Make sure to read the description at the start of the source code below.

 

Cheers,

Stephan

Inspiring
February 8, 2022

 

Update April 2022: Removed plain source code of paragraphStyleChanger 2.73 to cleanup scrolling/thread. Source code of version 2.73 is still attached to this post. Find newer version 2.74 lower down.

 

 

 

Community Expert
March 29, 2017

Hi Stephan,

unfortunately one cannot mark your post as helpful. But it is!
What did you change between 1.1 and 1.11 ?

I've seen 1.1 posted here:

2 aufeinanderfolgende Absatzformate tauschen/neu zuweisen?!? - Adobe InDesign Skriptwerkstatt - Seite 3 HilfDirSelbst.c…

Could not test it yet but had a quick look at its functionality and the UI.

Removing #target indesign is a good idea.


Wanted to run it from the ESTK first where InDesign CS6  8.1.0 was connected as target and was waiting in the background.
The result after starting the script was: InDesign CC 9.3.0 on the same machine was triggered and started up.

The first thing I did was removing the target instruction.


Note: I have several versions of InDesign installed side by side. CS6, CC, CC 2014.2, CC 2015.4.1 and CC 2017. Together with some prerelease versions. All on OSX 10.10.5.

Regards,
Uwe

Jongware
Community Expert
Community Expert
March 29, 2017

Nice! It even works perfect with my old work-horse InDesign CS4 -- you have to remove the line "#target indesign" for that, but that's all.

(As copying-and-pasting into a blank document may be a bit cumbersome for less experienced script users, I'd recommend to also add a download link.)

Inspiring
March 29, 2017

Thank you both very much for testing it! I removed the target-line as per your advices. And i am happy that it runs in all those version. You're right with the download...:

 

EDIT February 2022: See below for latest source code of "paragraphStyleChanger". Version 2 had lots of improvements. 

 

>> What did you change between 1.1 and 1.11 ?

I changed the way the "find/findNext style from current selection"-setting preselects styles in the dropdowns. You now have to select two paragraphs if you want to preselect the current AND the 'next' paragraph style. If selection is insertion point, it will only load the current style into the find-field and leave the followed-by field as ANY-STYLE. (That also fixed a bug if you selected a textframe with only one paragraph).

 

greetins,

Stephan