Skip to main content
Inspiring
July 28, 2022
Question

Looking for a script to make and apply character style from selected/found text.

  • July 28, 2022
  • 1 reply
  • 480 views

Hi

 

I have a certain type of text phrase that uses glyph fonts and this text will be in the middle of paragraphs, so unless I make and apply a different character style to each one of them they will miss up whenever I update my paragraph style.

 

So I'm looking for a script to make a new character style from the selected style the apply it to the same selected text.

 

The next level script will be to look for a text between these glyphs  TEXT﴿ then make the character style and apply it to the found text.

 

Thank you.

This topic has been closed for replies.

1 reply

Legend
July 28, 2022

If I understand your question, this may be doable with GREP styles. 

Here is how I set it up

Create a Character Style to hold the formatting you want for your selected text (in this case, I called it GREEN)

 

(?<=﴾).*?(?=﴿)

 

(In the code above, I pasted the left and right glyphs into the find box)

I think you will also need a character style applied to the glyphs if they are a different font from the text, so they don't loose formatting as well. 

If you also want to automate adding the character style to the glyphs, this will work as long as the keystoke for the glyph is not used elsewhere in another font

AK09MAuthor
Inspiring
July 29, 2022

The GREP (?<=﴿).*?(?=﴾) is perfect for selecting the text I want, but as I said every one of them needs its own character style because they use different fonts. I tried the GREP style but it didn't work.

 

 

AK09MAuthor
Inspiring
July 29, 2022

I created a character style with font size, and character direction only, then applied it to all of the found text using that GREP and it seems to work for now.