• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

paragraphStyleChanger v2.75

Participant ,
Mar 28, 2017 Mar 28, 2017

Copy link to clipboard

Copied

Hi,

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

 

EXAMPLE

- In the stories of the selected textframes find each paragraph with style "Headline1" if it is followed by "Subhead1" and change it to "Headline2" followed by "Subhead 2".

 

Find the newest version lower down below.

 

The script has a lot of options and use cases and gotten better over the years, you can use it on almost any kind if nested selection of groups and anchored opjects now too.

 

If you give me feedback, perhaps supply me with some example-document with the situation, where the error occured. But a description will work too.

 

(It's originally modeled after "Fix paragraph style combinations" by Thomas Silkjær, 2009, and its now WAY more advanced -

Thanks,

Stephan Möbius

__________

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.

 

TOPICS
Scripting

Views

4.5K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 29, 2017 Mar 29, 2017

Copy link to clipboard

Copied

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.)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Mar 29, 2017 Mar 29, 2017

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 29, 2017 Mar 29, 2017

Copy link to clipboard

Copied

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 - Seit...

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Feb 07, 2022 Feb 07, 2022

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Feb 07, 2022 Feb 07, 2022

Copy link to clipboard

Copied

 

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.

 

 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 19, 2022 Apr 19, 2022

Copy link to clipboard

Copied

Hi Stephan. Thanks a lot for your work. I've been using version 1.11 of the script for a long time. I've downloaded version 2 and i'm happy with the option of "catching" a selection of two consecutive paragraphs. Great!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Apr 19, 2022 Apr 19, 2022

Copy link to clipboard

Copied

Thank you for writing! I am happy when it is found and used.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 21, 2022 Apr 21, 2022

Copy link to clipboard

Copied

One more thing, Stephan. I have found that the script changes consecutive paragraphs inside a table if the text cursor is inside a table. But if no text frame is selected the script ignores the text inside the tables. Is it possible for the script to catch paragraphs inside a table? Thanks in advance!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Apr 22, 2022 Apr 22, 2022

Copy link to clipboard

Copied

Hello Alberto,

yes, the script used to work on a selected table, or any range of table cells. It also works on a selected textrange or selection of paragraphs inside a cell. I checked if paragraphStyleChanger still works that way and found that for some reason v2.73 no longer works on a fully selected table. I ended up upgrading the script to version 2.75 which now works with a lot more cases of NESTED objects – tables inside of tables, anchored textframes inside of stories, ... inside of groups ... or most other wild combinations. Try if it works for you. See below.

 

Cheers,

Stephan

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Apr 23, 2022 Apr 23, 2022

Copy link to clipboard

Copied

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-JB... 

 

or rename attached .txt-file to .jsx.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Aug 27, 2022 Aug 27, 2022

Copy link to clipboard

Copied

LATEST

@Stephan Moebius 

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

Best
Mohammad Hasanin

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines