Skip to main content
Known Participant
January 27, 2020
Question

Change bullet style to paragraph style.

  • January 27, 2020
  • 3 replies
  • 839 views

Hello friends, I would like some help on how to change the character style of the marker through a script.

In the video I have a style "15_MARCADOR PRINCIPAL, I need to enter his settings and change the character style of the marker to apply another color.

Thank you for your help.

 

This topic has been closed for replies.

3 replies

Community Expert
January 27, 2020

Hi Flavio,

I gave some hints and a possible algorithm.

 

That algorithm should be refined. Without seeing into your actual InDesign documents this could be quite a lot of guesswork. An all-purpose bullet proof algorithm would mean spending hours of hours on the project. Writing code and testing. 10% for writing code, 90% for testing.

 

One cannot expect that of a forum answer, I think.

 

Regards,
Uwe Laubender

( ACP )

Known Participant
January 27, 2020

When I create a greph and execute it it works as expected. I have a script that turns the greph query into code. But when I apply the generated code, it goes back to the previous color and does not change the color. As in the video below.

 

Community Expert
January 27, 2020

Hi Flavio,

You could reach the applied character style for the bullet through:

myParaStyle.bulletsCharacterStyle

 

Where myParaStyle is a variable that holds the actual paragraph style that is applied to the bullet text.

 

If you want to change the fill color of the character style of the bullet access it through:

myParaStyle.bulletsCharacterStyle.fillColor

 

Note: You have to be prepared for several cases.

 

1. Does the color you want to assign exists in the document?

If not, first add it to the document.

 

2. Is the applied paragraph style for bullet text the same in all documents of the book?

If not, is it the only paragraph style with bullets in the document? Yes? Then you could identify it by looping the allParagraphStyles array. Check if the value for property bulletsAndNumberingListType is ListType.BULLET_LIST.

 

3. Is the value of myParaStyle.bulletsCharacterStyle the [None] character style?

Check for: app.documents[0].characterStyles[0].

Then you have to assign a character style first. If an appropriate style with the desired color does not exist, you have to create one and apply it to that property. Use the desired color in the style you create.

 

Regards,
Uwe Laubender

( ACP )

Known Participant
January 27, 2020

Hello Laubender, it looks like you've already managed to tell me where to start, I'm quite a beginner in scripts, and some of the things you said seem a little beyond my current knowledge. But thanks for helping, I will research about it and hope to be able to solve it.

thanks.

vladan saveljic
Inspiring
January 27, 2020

Maybe I didn't understand good your issue.

However if you want to change the character style to apply another color you don't need to do it with a script.

Go to character style panel and change the settings you want in character style "04_MARCADOR PRIMARIO" because this character style has applied in your paragraph style "15_MARCADOR PRINCIPAL".

Or you can choose in the paragraph settings of the style "15_MARCADOR PRINCIPAL" one other character style that already exists, as in your video

Known Participant
January 27, 2020

I have a book with several sections, and for each section there is a bookmark style, so I would like a script, so that I can select the entire content of the section and change all the bookmarks in just one click.

Dave Creamer of IDEAS
Community Expert
Community Expert
January 27, 2020

Are you saying each section would have a different bullet color?

If not, and all bullets are the same in all sections, change one section, set it as Source Master, and sync the Charater syles accross the entire book.

Only a couple of clicks to do.

David Creamer: Community Expert (ACI and ACE 1995-2023)