Back

If your email is not recognized and you believe it should be, please contact us.

  • You must be logged in to reply to this topic.Login

Script to change char style of punctuation after italic/bold/etc.

Tagged: ,

Return to Member Forum

  • Author
    Posts
    • #74127
      Aaron Troia
      Participant

      I’m finding that a good majority of the corrections/revisions I do typesetting books, are things like italicizing/bolding commas after italic/bold words, I know this isn’t possible in GREP search as you cant search for two styles simultaneously. does anyone know of a script that would help me change punctuation after character styles to the same character style? or even helping me search for words and punctuation marks that have different character styles (including None), if that makes any sense, A GREP style find/replace would be ideal but at least being able to search for them would be a start.

    • #74128
      David Blatner
      Keymaster

      Hey there! It always seems like there should be an easy solution for things like this, but nothing comes to mind. Maybe someone else can think of something. But to get the ball rolling, I want to point out that you can find punctuation after any character with (\w)(?=[[:punct:]])
      You can change the Find Format section in Find/Change to find just those characters in bold or just in italic…

    • #74129
      Aaron Troia
      Participant

      Hey David! Thank you for your response, I normally would use something similar to what you had (I’m being explicit and using a comma as an example) (\w)(?=\,), and I agree, it seems like there should be an easy solution. The problem I’m running into is if I add a character style or font style to the GREP search, to narrow it down the search a bit, it fails since I’m looking for both a word with a character style applied to it (in this case, italic) followed by a comma that has no character style applied to it, and it still fails even when using a positive lookahead :(

    • #74573
      Chuck Nigash
      Member

      @ A.A. Ron: are you asking for ONE script to see ANY character style? the possibilities are too great; you would have to list all the char styles. GREP wont do it, jsx will.

      If you are only looking for a font style (different than char style), then you should be able to find the generic “italic” on a char style search and change to “roman or bold” of another char style.

      The awful truth about GREP is you get what you ask for 100% of the time and you have to be mindful what you ask for. Why don’t you offer a very specific example of what you are finding and changing here? Let us see a screenshot and perhaps it would be easier to take a shot.

Viewing 3 reply threads
  • You must be logged in to reply to this topic.
Forum Ads